What methods can be used to solve $y'=xy;y(0)=2$?

85 Views Asked by At

This is a very basic separable differential equation and can be easily solved as such:

$$\frac{dy}{dx}=xy;\,y(0)=2$$ $$\frac{dy}{dx}=xy$$ $$\frac{dy}{y}=xdx$$ $$\int\frac{dy}{y}=\int xdx$$ $$\ln|y|=\frac{x^2}{2}+C$$ $$y=Ke^\frac{x^2}{2};\,y(0)=2$$ $$2=Ke^\frac{0^2}{2}\therefore K=2$$ $$\therefore y=2e^\frac{x^2}{2}$$

I am wondering what other methods can be used to solve this problem and I intend for the answers of this question to become a compilation of these methods. I was able to solve it using Laplace Transforms and I will post it as an answer.

4

There are 4 best solutions below

0
On

Using Laplace Transforms: $\require{cancel}$ $$y'=xy;y(0)=2$$ $$\mathscr{L}\left\{\frac{y'}{y}\right\}=\mathscr{L}\{x\}$$ $$\mathscr{L}\left\{\frac{y'}{y}\right\}=\mathscr{L}\left\{x\right\}=\frac{1}{s^2}$$ $$ \mathscr{L}\left\{\frac{y'}{y}\right\}= \int\limits_0^\infty\frac{\frac{dy}{\cancel{dx}}}{y}e^{-sx}\cancel{dx}= \int\limits_0^\infty\frac{e^{-sx}}{y}dy= \ln|y|e^{-sx}|_0^\infty+\int\limits_0^\infty\ln|y|se^{-sx}dx= \ln|y(0)|+s\mathscr{L}\{\ln|y|\}$$

$$\ln|2|+s\mathscr{L}\{\ln|y|\}=\frac{1}{s^2}$$ $$\mathscr{L}\{\ln|y|\}=\frac{1}{s^3}-\frac{\ln2}{s}$$ $$\ln|y|=\frac{x^2}{2}+\ln2$$ $$y=2e^\frac{x^2}{2}$$

2
On

You could call it

  1. A first-order linear differential equation.
  2. An equation with an integrating factor that depends on $x$.
0
On

Power series:

Let $y(x) = \sum_{n=0}^\infty a_n x^n$. The initial condition imposes that $a_0=2$. Substituting this into the ODE, we obtain $$ \sum_{n=1}^\infty na_n x^{n-1} = \sum_{n=0} a_n x^{n+1}. $$ Shifting the indices and combining into a single series, we obtain $$ a_1 + \sum_{n=1}^\infty \left[(n+1)a_{n+1}-a_{n-1} \right]x^n = 0. $$ For this power series to be identically zero, each term must be zero, so we must have the following relations between the coefficients: $$ \begin{aligned} a_0&=2 \\ a_1&=0 \\ a_{n+2} &= \frac{a_n}{n+2}. \end{aligned} $$ This immediately implies that $a_n = 0$ for $n$ odd and $a_n = \frac{2}{n(n-2)(n-4)\dots(4)(2)}$ for $n$ even. If we only sum over even indices, i.e., $n = 2k$, we then have

$$ \begin{aligned} y(x) &= \sum_{k = 1}^\infty \frac{2x^{2k}}{(2k)(2k-2)(2k-4)\dots(4)(2)} \\ &= 2\sum_{k = 1}^\infty \frac{x^{2k}}{2^k(k)(k-1)(k-2)\dots(2)(1)} \\ &= 2\sum_{k=1}^\infty\frac{1}{k!}\left(\frac{x^2}{2}\right)^k \\ &= 2e^{\frac{x^2}{2}}.\quad\blacksquare \end{aligned} $$

0
On

$$y'=xy$$ Substitute $u=x^2$: $$\dfrac {dy}{dx^2}\dfrac {dx^2}{dx}=xy$$ $$x\left (2\dfrac{dy}{du}-y\right)=0$$ $$2y'-y=0$$ The DE has constant coefficients and can be solve with an integrating factor. $$(ye^{-u/2})'=0 $$