2.34   ODE No. 34

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

f(x)y(x)2+g(x)y(x)+y(x)=0 Mathematica : cpu = 0.090378 (sec), leaf count = 54

{{y(x)exp(1xg(K[1])dK[1])1xexp(1K[2]g(K[1])dK[1])f(K[2])dK[2]+c1}} Maple : cpu = 0.024 (sec), leaf count = 28

{y(x)=eg(x)dxeg(x)dxf(x)dx+_C1}

Hand solution

y2f+gy+y=0y=gyy2f(1)=P(x)+Q(x)y+R(x)y2

This is Bernoulli first order non-linear ODE. P(x)=0,Q(x)=g,R(x)=f. First step is to divide by y2(2)yy2=g1yf

Let u=1y, then u=yy2 and (2) becomesu=gufugu=f

Integrating factor is egdx henced(egdxu)=fegdxegdxu=fegdxdx+Cu=egdx(fegdxdx+C)

Hence y=1egdx(fegdx+C)=egdxfegdxdx+C

Let β=egdx theny=βfβdx+C

Verification

restart; 
eq:=diff(y(x),x)+f(x)*y(x)^2+g(x)*y(x) = 0; 
beta:=exp(-Int(g(x),x)): 
my_sol:=beta/(Int(f(x)*beta,x)+_C1); 
odetest(y(x)=my_sol,eq); 
0