kill(all)$

ode : part3,intro: ricatti 
peter.vlasschaert@gmail.com,04/02/2017

# Theory Ricatti : ODE (reaction kinetics)

(dy/dx) = p(x)*y^2+q(x)*y+r(x)
example: p(x)=-1

load('contrib_ode)$

depends([y,p,q,r],[x]);

eq1:'diff(y,x)=p(x)*y^2+q(x)*y+r(x);
eq2:subst(p(x)=-1,eq1);
eq3:contrib_ode(eq2,y,x)[1];
method;

eq4:part(eq3,1);
eq5:part(eq3,2);

eq4 : What subst. to use -> linear second order
      equation with nonconstant coefficients.

check solution : same as eq5

dependencies;

depends([%u],x);

dependencies;

eq6:subst(eq4,eq2);

eq7:ev(part(eq6,1),nouns)=ev(part(eq6,2),nouns);

eq8:radcan(eq7)*%u;

eq9:lhs(eq8)-rhs(eq8)=0;

ratsimp((%u*('diff(%u,x,2))-('diff(%u,x,1))^2)/%u-
    (%u^2*r(x)+%u*('diff(%u,x,1))*q(x)-('diff(%u,x,1))^2)/%u)=0;

;