Find solution of problem Cauchy $y'=x^2-y$

67 Views Asked by At

I have the following Cauchy problem$$y'=x^2-y,y(0)=1 $$ I need to find the solution in $[0, 1]$ section. I have done this steps to solve this problem: $$y'+y=0,$$$$dy/dx=-y$$$$dy/y=-dx$$ $$\int \frac{1}{y}dy=-\int dx$$ $$\ln|y|=-x+c$$ How continue solving this problem?

4

There are 4 best solutions below

2
On BEST ANSWER

You solved the homogeneous equation

you can use the variation of parameter to solve the inhomogeneous equation

$$y(x)=c(x)e^{-x}$$

Or use this approach $$y'=x^2-y,y(0)=1$$ $$y'+y=x^2$$ $$(ye^{x})'=e^{x}x^2$$ And integrate $$ye^{x}= \int e^{x}x^2 dx$$

0
On

So far you solved the homogeneous linear ODE whose solution is $y_h(x)=Ce^{-x}$. Now you need a particular solution of $y'+y=x^2$. Try something like $y_{\ast}(x)=ax^2+bx+c$ where the constants $a,b,c$ have to be found. The general solution is $y(x)=y_h(x)+y_{\ast}(x)$. Then find $C$ such that $y(0)=1$.

0
On

By trial and error:*

Observe that if $y=x^2$, $y'+y=x^2+2x$ and we have an extra term $2x$. Now try $x^2-2x$, that yields $y'+y=x^2-2x+2x-2=x^2-2$, giving an extra $-2$. Finally,

$$y=x^2-2x+2$$ and

$$y'+y=x^2-2x+2+2x-2=x^2.$$

Now with this expression $y(0)=2$, and to reach the imposed initial condition you compensate with the homogeneous part $Ce^{-x}$, picking the constant $C$ such that $2+Ce^{-0}=1$.

$$y(x)=x^2-2x+2-e^{-x}.$$


*Given that the RHS to obtain is a polynomial, the process is guaranteed to terminate (the extra terms will go in decreasing degrees).

0
On

$$\ln|y|=-x+c \implies y= ce^{-x}$$

For your particular solution, let $$y=ax^2+bx+c$$ and plug into your inhomogenuous equation to find coefficients.

You come uo with $$y(x)=x^2-2x+2+ce^{-x}.$$

The initial condition $$y(0)=1 \implies y(x)=x^2-2x+2-e^{-x}.$$