2.35   ODE No. 35

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

f(x)(2ay(x)+b+y(x)2)+y(x)=0 Mathematica : cpu = 0.0624036 (sec), leaf count = 48

{{y(x)ba2tan(ba2(1xf(K[1])dK[1]+c1))a}}

Maple : cpu = 0.073 (sec), leaf count = 35

{y(x)=tanh(a2b(_C1+f(x)dx))a2ba}

Hand solution

y(x)+f(x)(2ay(x)+b+y2(x))=0y(x)=2af(x)y(x)bf(x)f(x)y2(x)(1)=P(x)+Q(x)y+R(x)y2

This is Riccati first order non-linear ODE. P(x)=bf(x),Q(x)=2af(x),R(x)=f(x).

Let y(x)=u(x)u(x)R(x)=u(x)u(x)f(x)

Hence

y(x)=u(x)u(x)f(x)(u(x))2u2(x)f(x)u(x)f(x)u(x)f2(x)

Equating this to RHS of (1) gives

u(x)u(x)f(x)(u(x))2u2(x)f(x)u(x)f(x)u(x)f2(x)=2af(x)y(x)bf(x)f(x)y2(x)=2af(x)[u(x)u(x)f(x)]bf(x)f(x)[u(x)u(x)f(x)]2=2au(x)u(x)bf(x)u(x)2u2(x)f(x)

Simplifying

u(x)(u(x))2u(x)u(x)f(x)f(x)=2au(x)f(x)u(x)bf2(x)u(x)2u(x)u(x)u(x)f(x)f(x)=2au(x)f(x)u(x)bf2(x)u(x)+u(x)(f(x)f(x)+2af(x))+u(x)bf2(x)=0

Second order ODE with variable coefficients. Since coefficients are variables and not constants, a power series method is the standard way to continue. When I tried solving this now pretending the coefficients are constants in time, using the standard auxiliary equation method, the solution did verify OK. I need to look more into this. For now, this is solved using standard method for solving second order ODE with constant coefficients.

u(x)=C1exp(f(x)bdx(ba2bb+ab)b)+C2exp(f(x)bdx(ba2bb+ab)b)

Hence

u(x)=C1f(x)bb(a2+bbb+ba)ef(x)bdxb(a2+bbb+ba)+C2f(x)bb(a2+bbb+ba)ef(x)bdxb(a2+bbb+ba)

Therefore

y=u(x)u(x)f(x)=C1f(x)bb(a2+bbb+ba)ef(x)bdxb(a2+bbb+ba)+C2f(x)bb(a2+bbb+ba)ef(x)bdxb(a2+bbb+ba)f(x)[C1exp(f(x)bdx(ba2bb+ab)b)+C2exp(f(x)bdx(ba2bb+ab)b)]

Verification

restart; 
book:=diff(y(x),x)+f(x)*(2*a*y(x)+b+y(x)^2)=0; 
eqU:=diff(u(x),x$2)+diff(u(x),x)*(- diff(f(x),x)/f(x)+2*a*f(x))+u(x)*f(x)^2*b=0; 
solU:=dsolve(eqU,u(x)); 
my_sol:=diff(rhs(solU),x)/(rhs(solU)*f(x)); 
odetest(y(x)=my_sol,book); 
0