Differential equation with variation of constants

88 Views Asked by At

I found an old exam with the the question to solve this differential:

$$y'(x)-2xy(x)=\sinh(x)\cdot e^{x^2} ~~{\rm with}~~ y(0)=0$$

I know that I should probably solve the homogenous part first and then use the method of the variation of the constants to solve for the inhomogenous part.

I do have to start with saying that the $\sinh(x)$ is throwing me off a little and I'm not even sure what the homogenous part is.

Thanks xx

2

There are 2 best solutions below

0
On

The homogeneous equation,

$$y'(x)-2xy(x)=0$$

is separable and gives the solution

$$y_h(x)=ce^{x^2}.$$

Now by variation of the constant,

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

gives

$$c'(x)e^{x^2}+c(x)2xe^{x^2}-2xc(x)e^{x^2}=\sinh(x)e^{x^2}$$

or

$$c'(x)=\sinh(x).$$

The rest is yours.

1
On

So we start by solving the homogeneous ODE, i.e

\begin{equation} y'(x)-2xy(x)=0. \end{equation}

This can be done by seperation of variables. The above equation is equivalent to

\begin{equation} \begin{aligned} &\frac{dy}{y}=2xdx\\ \iff&\log{\lvert y\rvert}+c=x^2\\ \iff&y_h(x)=ce^{x^2}, \end{aligned} \end{equation} for $c\in\mathbb{R}$. Note that the absolute value can be dropped, since the r.h.s. of the equation \begin{equation} \lvert y(x) \rvert=De^{x^2} \end{equation} is non-negative with $D\geq0$. Now that we found the homogeneous solution $y_h$, we can obtain the particular solution $y_p$ by the variation of constants Ansatz: \begin{equation} y_p(x)=c(x)e^{x^2}. \end{equation} Plugging this into the inhomogenous ODE, we get \begin{equation} \begin{aligned} &{y_p}'(x)-2xy_p(x)=\sinh{(x)}e^{x^2}\\ \iff&c'(x)e^{x^2}+c(x)2xe^{x^2}-2xc(x)e^{x^2}=\sinh{(x)}e^{x^2}\\ \iff&c'(x)e^{x^2}=\sinh{(x)}e^{x^2}\\ \iff&c'(x)=\sinh{(x)}\\ \iff&c(x)=\cosh{(x)}+\tilde{c}, \end{aligned} \end{equation} with $\tilde{c}\in\mathbb{R}$. So our particular solution reduces to \begin{equation} y_p(x)=\left(\cosh{(x)}+\tilde{c}\right)e^{x^2}. \end{equation} By linearity of the ODE the general solution can be written as a sum of the homogeneous and particular solution, i.e. \begin{equation} y_{gen}(x)=y_h(x)+y_p(x)=ce^{x^2}+\cosh{(x)}e^{x^2}+\tilde{c}e^{x^2}=\left(C+\cosh{(x)}\right)e^{x^2}. \end{equation} Inserting the initial condition $y_{gen}(0)=0$, we arrive at \begin{equation} y_{gen}(0)=C+1=0 \implies C=-1. \end{equation} So the unique solution to your initial value porblem is given by \begin{equation} y(x)=e^{x^2}\left( \cosh{(x)}-1\right). \end{equation}