Finding the mistake in solving ODE of the form $y'(x) = ay^2 (x) +b$

45 Views Asked by At

I was trying to solve the ODE $y'(x) = ay^2(x) +b$ given $a<0 ,b>0, y'(t) >0, y(0)=0$ yet the solution for which I found $y(x)$ doesn't fully fit the ODE.

Calculations I made: $ay^2+b=a(y^2+\frac{b}{a})\Rightarrow \frac{y'}{y^2+\frac{b}{a}} = a$ when $y^2 +\frac{b}{a} \neq 0$ from the given condition $y'(x)\neq0$ and $a<0$.

Integrating both sides $dx$: $\int \frac{y'}{y^2+\frac{b}{a}}dx =ax+c$ assigning $y = z\Rightarrow y' =\frac{dz}{dx} \Rightarrow dx = \frac{dz}{dy'} $ we get: $\int \frac{y'}{y^2+\frac{b}{a}}dx = \int \frac{y'}{y^2+\frac{b}{a}} \frac{1}{y'}dz =_{y'>0} \int \frac{1}{z^2+\frac{b}{a}}dz = arctan(\frac{z}{\sqrt{\frac{-b}{a}}})$

We got: $arctan(\frac{z}{\sqrt{\frac{-b}{a}}}) = ax+c$ from the condition $y(0)=0 \Rightarrow z(0)=0$ we get that $c=0$. so, $arctan(\frac{z}{\sqrt{\frac{-b}{a}}}) = ax \Rightarrow (\frac{z}{\sqrt{\frac{-b}{a}}}) = tan(ax)\Rightarrow z=y(x) =tan(ax)\cdot \sqrt{\frac{-b}{a}} $

The problem is: $y'(x) = (1+tan^2(ax))\cdot a\cdot \sqrt{\frac{-b}{a}} = a(tan^2(ax)\cdot\sqrt{\frac{-b}{a}}+\sqrt{\frac{-b}{a}})\neq a\cdot(tan^2(ax)\cdot \frac{b}{a}+\frac{b}{a}) $

2

There are 2 best solutions below

3
On BEST ANSWER

When you're integrating, $$\int \frac{1}{z^2+b/a} {\rm d}z$$

You need to take care that this isn't the format $$\int \frac{1}{x^2+A^2} = \frac 1A \arctan \left( \frac xA \right)$$

Since $\frac{b}{a}$ is negative. This in fact is of the format $$\int \frac{1}{x^2-A^2}= \frac{1}{2A} \ln \left( \left \vert \frac{x-A}{x+A} \right \vert\right)$$ with $A = \sqrt{ -\frac{b}{a}}$.

This is where you went wrong.

0
On

Almost as Jaideep Khare answered, without considering the signs of $a$ and/or $b$, the solution of $$y=a\,y^2+b$$ is effectively given (as you did) by $$y=\frac{\sqrt{b}}{\sqrt{a}} \tan \left(\sqrt{a} \sqrt{b} x+C\right)$$ and the initial condition makes $C=0$.

Now, if $a$ is negative, write it as $a=i^2 |a|$ to get $$y=\frac{\sqrt{b}}{i\sqrt{|a|}} \tan \left(i\sqrt{|a|} \sqrt{b} x+C\right)$$ and remember than $\tan(iz)=i\tanh(z)$ making by the end $$y=\frac{\sqrt{b}}{i\sqrt{|a|}} i\tanh \left(\sqrt{|a|} \sqrt{b} \,x\right)=\frac{\sqrt{b}}{\sqrt{|a|}} \tanh \left(\sqrt{|a|b} \, x\right)$$