Example 2. Solve the Euler equation $x^{2} y^{\prime \prime}-x y^{\prime}+2 y=x \ln x$.
Solution. The characteristic equation $k(k-1)-k+2=0$, or $k^{2}-$ $2 k+2=0$ has roots, $k_{1}=1-i, k_{2}=1+i$. Therefore, the general solution of the corresponding homogeneous equation will be

$$
y_{0.0}=x\left(C_{1} \cos \ln x+C_{2} \sin \ln x\right)
$$

We seek a particular solution in the form $y_{4}=x(A \ln x+B)$; we have

$$
y_{4}^{\prime}=A \ln x+B+A, \quad y_{4}^{\prime \prime}=\frac{A}{x}
$$

Substituting into the given equation, we get

$$
A x-x(A \ln x+A+B)+2 x(A \ln x+B)=x \ln x
$$

or

$$
A x \ln x+B x=x \ln x
$$

from which $A=1, B=0$. Thus, $y_{4}=x \ln x$. The general solution will be

$$
y=x\left(C_{1} \cos \ln x+C_{2} \sin \ln x\right)+x \ln x
$$

## Problems for Independent Solution

Integrate the following homogeneous Euler equations:

618. $x^{2} y^{\prime \prime}+x y^{\prime}-y=0$.
619. $x^{2} y^{\prime \prime}+3 x y^{\prime}+y=0$.
620. $x^{2} y^{\prime \prime}+2 x y^{\prime}+6 y=0$.
621. $x y^{\prime \prime}+y^{\prime}=0$.
622. $(x+2)^{2} y^{\prime \prime}+3(x+2) y^{\prime}-3 y=0$.
623. $(2 x+1)^{2} y^{\prime \prime}-2(2 x+1) y^{\prime}+4 y=0$.
624. $x^{2} y^{\prime \prime \prime}-3 x y^{\prime \prime}+3 y^{\prime}=0$.
625. $x^{2} y^{\prime \prime \prime}=2 y^{\prime}$.
626. $(x+1)^{2} y^{\prime \prime \prime}-12 y^{\prime}=0$.
627. $(2 x+1)^{2} y^{\prime \prime \prime}+2(2 x+1) y^{\prime \prime}+y^{\prime}=0$.

Solve the following non-homogeneous Euler equations:

628. $x^{2} y^{\prime \prime}+x y^{\prime}+y=x(6-\ln x)$.
629. $x^{2} y^{\prime \prime}-x y^{\prime}-3 y=-\frac{16 \ln x}{x}$.
630. $x^{2} y^{\prime \prime}+x y^{\prime}-y=x^{m}, \quad|m| \neq 1$.
631. $(x-2)^{2} y^{\prime \prime}-3(x-2) y^{\prime}+4 y=x$.
632. $x^{2} y^{\prime \prime}-2 y=\sin \ln x$.
633. $x^{2} y^{\prime \prime}-2 x y^{\prime}+2 y=x^{2}-2 x+2$.
634. $x^{2} y^{\prime \prime}+4 x y^{\prime}+2 y=2 \ln ^{2} x+12 x$.

$5^{\circ}$. Linear differential equations with variable coefficients. Lagrange's method. If a particular solution $y_{1}(x)$ of the equation

$$
y^{(n)}+p_{1}(x) y^{(n-1)}+\ldots+p_{n}(x) y=0
$$

is known, then the order of the equation can be reduced by one (without violating the linearity of the equation) by setting $y=y_{1} z$, where $z$ is a new unknown function, and then making the substitution $z^{\prime}=u$ (one can directly make the substitution $\left.u=\left(y / y_{1}\right)^{\prime}\right)$.

If $k$ particular linearly independent solutions of the equation (32) are known, then the order of the equation can be reduced by $k$ units.

The general solution of the equation

$$
y^{(n)}+p_{1}(x) y^{(n-1)}+\ldots+p_{n}(x) y=f(x)
$$

is the sum of any particular solution of the equation and the general solution of the corresponding homogeneous equation (32).

If a fundamental system of the corresponding homogeneous equation (32) is known, then the general solution of the non-homogeneous equation (33) can be found by the method of variation of constants (Lagrange's method).

The general solution of equation (32) has the form

$$
y=C_{1} y_{1}+C_{2} y_{2}+\ldots+C_{n} y_{n}
$$

where $C_{1}, C_{2}, \ldots, C_{n}$ are arbitrary constants.

We will seek the solution of equation (33) in the form

$$
y=C_{1}(x) y_{1}+C_{2}(x) y_{2}+\ldots+C_{n}(x) y_{n}
$$

where $C_{1}(x), C_{2}(x), \ldots, C_{n}(x)$ are some as yet unknown functions of $x$. To determine them, we obtain the system

$$
\left\{\begin{array}{l}
y_{1} C_{1}^{\prime}+y_{2} C_{2}^{\prime}+\ldots+y_{n} C_{n}^{\prime}=0 \\
y_{1}^{\prime} C_{1}^{\prime}+y_{2}^{\prime} C_{2}^{\prime}+\ldots+y_{n}^{\prime} C_{n}^{\prime}=0 \\
\cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \cdots \\
y_{1}^{(n-1)} C_{1}^{\prime}+y_{2}^{(n-1)} C_{2}^{\prime}+\ldots+y_{n}^{(n-1)} C_{n}^{\prime}=f(x)
\end{array}\right.
$$

Solving this system with respect to $C_{i}^{\prime}(x), i=1,2, \ldots, n$, we get

$$
\frac{d C_{i}}{d x}=\varphi_{i}(x), \quad i=1,2, \ldots, n
$$

from which

$$
C_{i}(x)=\int \varphi_{i}(x) d x+\tilde{C}_{i}, \quad i=1,2, \ldots, n
$$

where $\tilde{C}_{i}$ are arbitrary constants. Substituting the found values of $C_{i}(x)$ into (34), we obtain the general solution of equation (33).

In particular, for the second-order equation

$$
y^{\prime \prime}+p_{1}(x) y^{\prime}+p_{2}(x) y=f(x)
$$

the system (35) has the form

$$
\left\{\begin{array}{l}
y_{1} C_{1}^{\prime}+y_{2} C_{2}^{\prime}=0 \\
y_{1}^{\prime} C_{1}^{\prime}+y_{2}^{\prime} C_{2}^{\prime}=f(x)
\end{array}\right.
$$

Solving (36) with respect to $C_{1}^{\prime}$ and $C_{2}^{\prime}$, we get

$$
C_{1}^{\prime}=-\frac{y_{2} f(x)}{W\left[y_{1}, y_{2}\right]}, \quad C_{2}^{\prime}=\frac{y_{1} f(x)}{W\left[y_{1}, y_{2}\right]}
$$

from which we find

$$
C_{1}(x)=-\int \frac{y_{2} f(x)}{W\left[y_{1}, y_{2}\right]} d x+\widetilde{C}_{1}, \quad C_{2}(x)=\int \frac{y_{1} f(x)}{W\left[y_{1}, y_{2}\right]} d x+\widetilde{C}_{2}
$$

where $\widetilde{C}_{1}$ and $\widetilde{C}_{2}$ are constants of integration.

Remark. For the equation $a_{0}(x) y^{\prime \prime}+a_{1}(x) y^{\prime}+a_{2}(x) y=f(x)$, where $a_{0}(x) \neq 1$, $a_{0}(x) \neq 0$, the system (36) will look like this:

$$
\left\{\begin{array}{l}
y_{1} C_{1}^{\prime}+y_{2} C_{2}^{\prime}=0 \\
y_{1}^{\prime} C_{1}^{\prime}+y_{2}^{\prime} C_{2}^{\prime}=\frac{f(x)}{a_{0}(x)}
\end{array}\right.
$$