2.32   ODE No. 32

  1. Problem in Latex
  2. Mathematica input
  3. Maple input

y(x)+y(x)2sin(x)2tan(x)sec(x)=0 Mathematica : cpu = 0.444756 (sec), leaf count = 26

{{y(x)sec(x)(c12cos3(x))c1+cos3(x)}}

Maple : cpu = 0.503 (sec), leaf count = 28

{y(x)=2(cos(x))3_C12((cos(x))3_C12)cos(x)}

Hand solution

y+y2sin(x)2sinxcos2x=0y=2sinxcos2xy2sin(x)(1)=P(x)+Q(x)y+R(x)y2

This is Ricatti first order non-linear ODE. P(x)=2sinxcos2x,Q(x)=0,R(x)=sin(x). A particular solution is yp=1cosx, therefore the solution isy=yp+1uy=1cosx+1u

Hencey=sinxcos2xuu2 Equating this to RHS of (1) givessinxcos2xuu2=2sinxcos2xy2sin(x)=2sinxcos2x(1cosx+1u)2sin(x)=2sinxcos2x(1cos2x+1u2+2ucosx)sin(x)

Henceuu2=sinxcos2x+2sinxcos2xsin(x)cos2xsin(x)u22sin(x)ucosx=sin(x)u22sin(x)ucosx

Oru=sin(x)+2usin(x)cosxu2utan(x)=sin(x)

Integrating factor is e2tanxdx=e2ln(cosx)=cos2(x). Hence the above becomesd(ucos2x)=cos2(x)sin(x) Integrating both sidesucos2x=cos2(x)sin(x)dx+C=13cos3(x)+C

Hence u=13cos(x)+Ccos2x Thereforey=yp+1u=1cosx+113cos(x)+Ccos2x=1cosx+3cos2x3Ccos3(x)

Let 3C=C1y=1cosx+3cos2xC2cos3(x) Verification

restart; 
ode:=diff(y(x),x)+y(x)^2*sin(x)-2*sin(x)/cos(x)^2 = 0; 
my_sol:=1/cos(x)+ 3*cos(x)^2/(_C1-cos(x)^3); 
odetest(y(x)=my_sol,ode); 
0