2.27   ODE No. 27

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

ay(x)(y(x)x)+y(x)1=0 Mathematica : cpu = 2.64591 (sec), leaf count = 88

{{y(x)2πc1xerf(ax2)+2(c1eax22+ax)a2πc1erf(ax2)+2a}}

Maple : cpu = 0.418 (sec), leaf count = 72

{y(x)=1(2ae1/2ax2+x(πErf(2x2a)2a+2a3/2_C1))(πErf(2x2a)2a+2a3/2_C1)1}

Hand solution

y+ay(yx)1=0y=1(ay2ayx)(1)=1+ayxay2

This is Riccati first order non-linear ODE y=P(x)+A(x)y+R(x)y2 with P(x)=1,Q(x)=ax,R(x)=a. We can convert Riccati to Bernoulli which is easier to solve using the substitution u=yxu=y1=(1+ayxay2)1=(1+a(u+x)xa(u+x)2)1=1+aux+ax2a(u2+x2+2ux)1=1+aux+ax2au2ax22aux1=auxau2u=auxau2

This is of the form u=P(x)+Q(x)u+R(x)u2 and since P(x)=0 then it is Bernoulli differential equation. (when P(x)0 and R(x)0 it is Riccati). To solve Bernoulli we always start by dividing by u2uu2=axua Then we let ζ=1u, hence ζ=uu2, therefore the above becomesζ=axζaζaxζ=a

Integrating factor is eaxdx=eax22, hence d(eax22ζ)=aeax22. Integrating both sides giveseax22ζ=aeax22dx+C But eax22dx=π2aerf(a2x) Thereforeeax22ζ=aπ2aerf(a2x)+Cζ=eax22(aπ2aerf(a2x)+C)

Henceu=1ζ=eax22(aπ2aerf(a2x)+C)1

Since u=yx theny=u+x=eax22(aπ2aerf(a2x)+C)1+x=eax22aπ2erf(a2x)+C+x

Verification

eq:=diff(y(x),x)+a*y(x)*(y(x)-x)-1 = 0; 
sol:=exp(-a*x^2/2)/(sqrt(a*Pi/2)*erf(sqrt(a/2)*x)+_C1)+x; 
odetest(y(x)=sol,eq); 
0