\( \DeclareMathOperator{\abs}{abs} \newcommand{\ensuremath}[1]{\mbox{$#1$}} \)
(%i1) kill(all)$

ode : part3,intro: ricatti
[email protected],04/02/2017

Theory Ricatti : ODE (reaction kinetics)

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

(%i1) load('contrib_ode)$
(%i2) depends([y,p,q,r],[x]);
\[\tag{\%{}o2}\label{o2} [\operatorname{y}(x),\operatorname{p}(x),\operatorname{q}(x),\operatorname{r}(x)]\]
(%i6) 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;
\[\tag{eq1}\label{eq1}\frac{d}{dx}y=\operatorname{p}(x)\,{{y}^{2}}+\operatorname{q}(x)y+\operatorname{r}(x)\] \[\tag{eq2}\label{eq2}\frac{d}{dx}y=-{{y}^{2}}+\operatorname{q}(x)y+\operatorname{r}(x)\] \[\tag{eq3}\label{eq3}[y=\frac{\frac{d}{dx}\mathit{\%{}u}}{\mathit{\%{}u}},\mathit{\%{}u}\,\operatorname{r}(x)+\left( \frac{d}{dx}\mathit{\%{}u}\right) \,\operatorname{q}(x)-\frac{{{d}^{2}}}{d{{x}^{2}}}\mathit{\%{}u}=0]\] \[\tag{\%{}o6}\label{o6} \mathit{riccati}\]
(%i8) eq4:part(eq3,1);
eq5:part(eq3,2);
\[\tag{eq4}\label{eq4}y=\frac{\frac{d}{dx}\mathit{\%{}u}}{\mathit{\%{}u}}\] \[\tag{eq5}\label{eq5}\mathit{\%{}u}\,\operatorname{r}(x)+\left( \frac{d}{dx}\mathit{\%{}u}\right) \,\operatorname{q}(x)-\frac{{{d}^{2}}}{d{{x}^{2}}}\mathit{\%{}u}=0\]

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

check solution : same as eq5

(%i9) dependencies;
\[\tag{\%{}o9}\label{o9} [\operatorname{y}(x),\operatorname{p}(x),\operatorname{q}(x),\operatorname{r}(x)]\]
(%i10) depends([%u],x);
\[\tag{\%{}o10}\label{o10} [\operatorname{\%{}u}(x)]\]
(%i11) dependencies;
\[\tag{\%{}o11}\label{o11} [\operatorname{y}(x),\operatorname{p}(x),\operatorname{q}(x),\operatorname{r}(x),\operatorname{\%{}u}(x)]\]
(%i12) eq6:subst(eq4,eq2);
\[\tag{eq6}\label{eq6}\frac{d}{dx}\frac{\frac{d}{dx}\mathit{\%{}u}}{\mathit{\%{}u}}=\operatorname{r}(x)+\frac{\left( \frac{d}{dx}\mathit{\%{}u}\right) \,\operatorname{q}(x)}{\mathit{\%{}u}}-\frac{{{\left( \frac{d}{dx}\mathit{\%{}u}\right) }^{2}}}{{{\mathit{\%{}u}}^{2}}}\]
(%i13) eq7:ev(part(eq6,1),nouns)=ev(part(eq6,2),nouns);
\[\tag{eq7}\label{eq7}\frac{\frac{{{d}^{2}}}{d{{x}^{2}}}\mathit{\%{}u}}{\mathit{\%{}u}}-\frac{{{\left( \frac{d}{dx}\mathit{\%{}u}\right) }^{2}}}{{{\mathit{\%{}u}}^{2}}}=\operatorname{r}(x)+\frac{\left( \frac{d}{dx}\mathit{\%{}u}\right) \,\operatorname{q}(x)}{\mathit{\%{}u}}-\frac{{{\left( \frac{d}{dx}\mathit{\%{}u}\right) }^{2}}}{{{\mathit{\%{}u}}^{2}}}\]
(%i14) eq8:radcan(eq7)*%u;
\[\tag{eq8}\label{eq8}\frac{\mathit{\%{}u}\,\left( \frac{{{d}^{2}}}{d{{x}^{2}}}\mathit{\%{}u}\right) -{{\left( \frac{d}{dx}\mathit{\%{}u}\right) }^{2}}}{\mathit{\%{}u}}=\frac{{{\mathit{\%{}u}}^{2}}\,\operatorname{r}(x)+\mathit{\%{}u}\,\left( \frac{d}{dx}\mathit{\%{}u}\right) \,\operatorname{q}(x)-{{\left( \frac{d}{dx}\mathit{\%{}u}\right) }^{2}}}{\mathit{\%{}u}}\]
(%i15) eq9:lhs(eq8)-rhs(eq8)=0;
\[\tag{eq9}\label{eq9}\frac{\mathit{\%{}u}\,\left( \frac{{{d}^{2}}}{d{{x}^{2}}}\mathit{\%{}u}\right) -{{\left( \frac{d}{dx}\mathit{\%{}u}\right) }^{2}}}{\mathit{\%{}u}}-\frac{{{\mathit{\%{}u}}^{2}}\,\operatorname{r}(x)+\mathit{\%{}u}\,\left( \frac{d}{dx}\mathit{\%{}u}\right) \,\operatorname{q}(x)-{{\left( \frac{d}{dx}\mathit{\%{}u}\right) }^{2}}}{\mathit{\%{}u}}=0\]
(%i16) 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;
\[\tag{\%{}o16}\label{o16} -\mathit{\%{}u}\,\operatorname{r}(x)-\left( \frac{d}{dx}\mathit{\%{}u}\right) \,\operatorname{q}(x)+\frac{{{d}^{2}}}{d{{x}^{2}}}\mathit{\%{}u}=0\]
--> ;

Created with wxMaxima.