Calculus – Showing an ODE Doesn’t Have a Solution

calculusordinary differential equations

I was given an ODE: $$x y'+3y+y^2=x^2$$
We can rewrite this as: $$y'=\frac{-1}{x}y^2-\frac{3}{x}y+x$$
which is obviously a Riccati equation so to solve it we need to find a particular solution for $y$, let's denote it as $y_p$. Once we find that particular solution we can make a substitution $\displaystyle y=y_p+\frac{1}{z}$, where $z=z(x)$.
The problem is I couldn't come up with any $y_p$ that would satisfy the given equation. So I decided to calculate it using Mathematica and I got, what looks like a complex function.

Since $y$ has to be a real valued function, it seems that there are no solutions to our ODE. How can we conclude that just from the given ODE? Is there something simple I'm missing here?

Edit
Since it was requested in the comments, here is the solution I got from Mathematica:
$y(x)=-\frac{i x \left(-\frac{2 \sqrt{\frac{2}{\pi }} \left(-\frac{3 \cosh (x)}{x^2}+\frac{3 \sinh (x)}{x}-\cosh (x)\right)}{\sqrt{i x}}+\frac{\sqrt{\frac{2}{\pi }} c_1 \left(-\frac{3 i \sinh (x)}{x^2}-i \sinh (x)+\frac{3 i \cosh (x)}{x}\right)}{\sqrt{i x}}-\frac{i \sqrt{\frac{2}{\pi }} c_1 \sinh (x)}{\sqrt{i x}}\right)+\frac{3 \sqrt{\frac{2}{\pi }} c_1 \left(\frac{\sinh (x)}{x}-\cosh (x)\right)}{\sqrt{i x}}}{2 \left(\frac{\sqrt{\frac{2}{\pi }} \left(\frac{i \cosh (x)}{x}-i \sinh (x)\right)}{\sqrt{i x}}+\frac{\sqrt{\frac{2}{\pi }} c_1 \left(\frac{\sinh (x)}{x}-\cosh (x)\right)}{\sqrt{i x}}\right)}$

Best Answer

The other approach to Riccati equations introduces a degree of freedom by setting $y=u/v$ to get $$ x(u'v-uv')+3uv+u^2=x^2v^2. $$ Now one can group terms with a factor of $u$ and those with a factor of $v$. There is some choice in distributing the mixed term $$ (xu'+au-x^2v)v=u(xv'+(a-3)v-u) $$ The degree of freedom that was introduced is used up in setting both sides to zero. For $a=0$ this gives $$ u'=xv\\ xv'=u+3v $$ and combined $$ xv''=xv+2v' $$ The WA solution suggests the parametrization $v=xz'-z=x^2(z/x)'$, $v'=xz''$. Inserted this gives $$ x^2z'''+xz''=2xz''+x^2z'-xz\\ (xD-1)(D^2-1)z=0\\ z''-z=w\\ xw'-w=0 $$ Solving backwards this gives $w=Cx$, $z=Ae^x+Be^{-x}+Cx$, $$ v=A(x-1)e^x-B(x+1)e^{-x},\\ u=xv'-3v=x^2z''-3xz'+3z \\=A(x^2-3x+3)e^x+B(x^2+3x+3)e^{-x}. \\~\\ y=\frac{A(x^2-3x+3)e^x+B(x^2+3x+3)e^{-x}}{A(x-1)e^x-B(x+1)e^{-x}} $$ This can also be expressed in hyperbolic functions

Related Question