OSU MTH 256 - Integrating Factors and Exact First Order ODE

Unformatted text preview:

Integrating Factors and Exact First Order ODEDate: Jan 22, 2002 Last Revision: Jan 22, 2002 Maple 6Bent E. [email protected]@math.orst.eduCourse: Mth 256Term: Winter 2002File name: 256w2002-intfactors-exact-ode.mwsThis worksheet demonstrates some of Maple’s facilities for finding integrating factors and for solving exact ODEs. The implicit solution of a first order exact ODE that we find by integration in Mth 256 is what is technically called a first integral. What we study in Mth 256 is a special case of a much more general concept. In Maple the command for finding first integrals of exact ODEs is firint().Before we can find a first integral we may first have to find an integrating factor (so we will have an exact equation to feed to firint() ). Again the integrating factors studied in Mth 256 are a special case of a much more general concept. The Maple command for finding integrating factors is intfactor().Some of the problems below are from our text.> restart;We will need to load the DE tools library.> with(DEtools):Problem 1First let’s integrate an exact equation. > ode01:=(3*x+2*y(x))*diff(y(x),x)+(2*x+3*y(x))=0; := ode01 = + + () + 3 x 2()y x∂∂x()y x 2 x 3()y x 0> soln01:=firint(ode01); := soln01 = + + + 3 x ()y x ()y x2x2_C1 0We can put the solution in a more customary form by making a couple of substitutions:> subs(y(x)=y,_C1=C,soln01); = + + + 3 xy y2x2C 0I will make such cosmetic substitutions below without any additional comment. Note the solution is quadratic in y. Thus if we try dsolve() it will return two explicit solutions here:> s01:=dsolve(ode01); := s01 , = ()y x− − 32x_C112 + 5 x2_C124_C1 = ()y x− + 32x_C112 + 5 x2_C124_C1> soln01a:=s01[1]: subs(_C1=C,y(x)=y,simplify(soln01a)); = y −12 + 3 xC + 5 x2C24C> soln01b:=s01[2]: subs(_C1=C,y(x)=y,simplify(soln01b)); = y −12 − 3 xC + 5 x2C24CProblem 2Let’s see how to find an integrating factor and then use it to solve a nonexact ODE.> ode02:=(4*x*y(x)^2+y(x))+(6*y(x)^3-x)*diff(y(x),x); := ode02 + + 4 x ()y x2()y x () − 6()y x3x∂∂x()y x> mu02:=intfactor(ode02); := µ021()y x2> fint02:=firint(mu02*ode02): subs(_C1=C,y(x)=y,fint02); = + + + 3 y2xy2 x2C 0Problem 3Here’s another nonexact ODE.> ode03:=y(x)*(log(y(x))+exp(x))+(x+y(x)*cos(y(x)))*diff(y(x),x)=0;:= ode03 = + ()y x () + ()ln ( )y x ex() + x ()y x ()cos ( )y x∂∂x()y x 0> mu03:=intfactor(ode03); := µ031()y x> firint(mu03*ode03): subs(_C1=C,y(x)=y,%); = + + + x ()ln y ()sin y exC 0Problem 4This time let’s check for exactness before doing anything else.> M04:=7*x^4*y-3*y^8; N04:=2*x^5-9*x*y^7; := M04 − 7 x4y 3 y8 := N04 − 2 x59 xy7> diff(M04,y)-diff(N04,x);− − 3 x415 y7We see M + N dy/dx is not exact, so let’s look for an integrating factor and then integrate.> ode04:=subs(y=y(x),M04)+subs(y=y(x),N04)*diff(y(x),x)=0; := ode04 = − + 7 x4()y x 3()y x8() − 2 x59 x ()y x7∂∂x()y x 0> mu04:=intfactor(ode04); := µ041x () − ()y x7x4()y x> firint(mu04*ode04): fir04:=subs(_C1=C,y(x)=y,%); := fir04 = + + + 2()ln y ()ln − y7x43()ln xC0It looks like Maple missed an opportunity to simplify here. Let’s exponentiate both sides of the equation fir04.> simplify(exp(lhs(fir04)))=exp(rhs(fir04)); subs(exp(C)=1/C,%); = y2() − y7x4x3eC1 = y2() − y7x4x3C1Here’s another integrating factor (found by hand):> mu04b:=x^2*y(x); := mu04b x2()y x> firint(mu04b*ode04): subs(_C1=C,y(x)=y,%); = − + + x7y2x3y9C 0We have the same solution and we see that Maple does not always find the "simplest" integrating factor.!Problem 5> M05:=x^2*y^3; N05:=x*(1+y^2); := M05 x2y3 := N05 x () + 1 y2> ode05:=subs(y=y(x),M05)+subs(y=y(x),N05)*diff(y(x),x)=0; := ode05 = + x2()y x3x () + 1()y x2∂∂x()y x 0> diff(M05,y)-diff(N05,x); − − 3 x2y21 y2We see ODE 5 is not exact. Let’s find and integrating factor and then a first integral.> mu05:=intfactor(ode05); := µ051x ()y x3> firint(mu05*ode05): subs(y(x)=y,_C1=C,%); = − + + + 121y2()ln y12x2C 0Problem 6> M06:=sin(y)/y-2*exp(-x)*sin(x); := M06 − ()sin yy2 e()−x()sin x> N06:=(cos(y)+2*exp(-x)*cos(x))/y; := N06 + ()cos y 2 e()−x()cos xy> ode06:=subs(y=y(x),M06)+subs(y=y(x),N06)*diff(y(x),x)=0;:= ode06 = − + ()sin ( )y x()y x2 e()−x()sin x() + ()cos ( )y x 2 e()−x()cos x∂∂x()y x()y x0> diff(M06,y)-diff(N06,x); − − ()cos yy()sin yy2− − 2e()−x()cos x 2e()−x()sin xyWe see ODE 6 is not exact. Let’s look for an integrating factor. > mu06:=intfactor(ode06); := µ06 ,1 + ()sin ( )y x 2 e()−x()cos x ()y x + ex()cos ( )y x 2()cos x + ()cos ( )y x 2 e()−x()cos xMaple returned two integrating factors:> mu06a:=mu06[1]; mu06b:=mu06[2]; := mu06a1 + ()sin ( )y x 2 e()−x()cos x ()y x := mu06b + ex()cos ( )y x 2()cos x + ()cos ( )y x 2 e()−x()cos x> firint(mu06a*ode06);Error, (in ODEtools/firint) The given ODE is not exact > firint(mu06b*ode06);Error, (in ODEtools/firint) The given ODE is not exact Something is wrong! Maple 6 spent much time computing these two integrating factors, but they do not work. Maybe I made an error or maybe Maple needs help on this one. In any case we see that it is a good idea to check Maple’s answers.Fortunately an integrating factor is know for this problem (and it is a mystery that Maple does not find it).> mu06c:=y(x)*exp(x); # pulled out of the hat := mu06c ()y x ex> firint(mu06c*ode06): subs(y(x)=y,_C1=C, %); = + + ex()sin y 2 exe()−x()cos xy C 0Problem 7> ode07:=(3*x+2*y(x))+(4*x-2*y(x))*diff(y(x),x)=0; := ode07 = + + 3 x 2()y x () − 4 x 2()y x∂∂x()y x 0We can use firint() to determine if an ODE is exact (rather than checking by hand as above):> firint(ode07);Error, (in ODEtools/firint) The given ODE is not exact > mu07:=intfactor(ode07); := µ071− − + 3 x26 x ()y x 2()y x2> firint(mu07*ode07): subs(y(x)=y,_C1=C, %); = + + 14()ln − − + 3 x26 xy 2 y213015arctanh130()− + 6 x 4 y 15xC 0Problem 8In this problem we have an ODE with a parameter and we want to know for what value of the parameter the equation is exact. Then solve the exact equation.> M08:=y*exp(2*x*y)+x; N08:=b*x*exp(2*x*y); := M08 + y e()2 xyx := N08 b x e()2 xy> > ode08:=subs(y=y(x),M08)+subs(y=y(x),N08)*diff(y(x),x)=0; := ode08 = + + ()y xe()2 x ()y xxbxe()2 x


View Full Document

OSU MTH 256 - Integrating Factors and Exact First Order ODE

Download Integrating Factors and Exact First Order ODE
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Integrating Factors and Exact First Order ODE and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Integrating Factors and Exact First Order ODE 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?