Find the general solution of y'' + (2)/(x)y' - a^2y = 2, a≠0
Find the general solution of $y'' + \frac{2}{x}y' - a^2y = 2, \qquad a\neq0$.
Explanation of Method
The same $u=xy$ substitution used for $xy''+2y'-xy=e^x$ reduces this parametrized equation to the constant-coefficient $u''-a^2u=2x$, for every real $a\neq0$.
Step 1: The substitution $u=xy$
As in the companion problem with $xy''+2y'-xy=e^x$, the same substitution $u=xy$, i.e.\ $y=u/x$, is effective here: for any function $y=u/x$, the identities
\[ y' = \frac{u'}{x}-\frac{u}{x^2}, \qquad y'' = \frac{u''}{x}-\frac{2u'}{x^2}+\frac{2u}{x^3} \]
combine, when $y''$ and $(2/x)y'$ are added, so that the $u'$-terms cancel: \[y'' + \frac{2}{x}y' = \left(\frac{u''}{x}-\frac{2u'}{x^2}+\frac{2u}{x^3}\right) + \left(\frac{2u'}{x^2}-\frac{2u}{x^3}\right) = \frac{u''}{x}.\]
Step 2: Transforming the full equation
Since $-a^2y=-a^2u/x$, the left-hand side becomes
\[ y'' + \frac{2}{x}y' - a^2y = \frac{u''}{x} - \frac{a^2u}{x} = \frac{u''-a^2u}{x}. \]
Setting this equal to $2$ and multiplying through by $x$: $u'' - a^2u = 2x$.
Step 3: Homogeneous solution
The characteristic equation $r^2-a^2=0$ has roots $r=\pm a$ (real and distinct, since $a\neq0$), so
\[ u_h = C_1e^{ax} + C_2e^{-ax}. \]
Step 4: Particular solution
The forcing term $2x$ is a degree-1 polynomial, and $r=0$ is not a root ($a\neq0$), so try $u_p=Ax+B$. With $u_p''=0$: \[-a^2(Ax+B) = 2x \;\Longrightarrow\; A = -\frac{2}{a^2}, \quad B=0.\]
Hence $u_p=-2x/a^2$, and
\[ u = C_1e^{ax} + C_2e^{-ax} - \frac{2x}{a^2}. \]
Step 5: Back-substituting $y=u/x$
The solution is recorded in the result below.
Step 6: Verification — homogeneous piece
For $y_1=e^{ax}/x$, the product rule gives $y_1'=\dfrac{(ax-1)e^{ax}}{x^2}$, and differentiating again, $y_1'' = \frac{(a^2x^2-2ax+2)e^{ax}}{x^3}$.
Substituting into $y''+(2/x)y'-a^2y$, writing every term over $x^3$: \[y_1''+\frac{2}{x}y_1'-a^2y_1 = \frac{e^{ax}\bigl[(a^2x^2-2ax+2) + (2ax-2) - a^2x^2\bigr]}{x^3} = \frac{e^{ax}\cdot0}{x^3} = 0.\ \checkmark\]
(Replacing $a\to-a$ throughout confirms $y_2=e^{-ax}/x$ by the identical computation.)
Step 7: Verification — particular piece
For $y_p=-2/a^2$ (a constant), $y_p'=y_p''=0$, so
\[ y_p''+\frac{2}{x}y_p'-a^2y_p = 0+0-a^2\left(-\frac{2}{a^2}\right) = 2.\ \checkmark \]
Result
Final answer:
\[\boxed{\,y = \frac{C_1e^{ax}}{x} + \frac{C_2e^{-ax}}{x} - \frac{2}{a^2}\,}\]
Remark
Independence of $y_1,y_2$ — Wronskian. In standard form the coefficient of $y'$ is $P(x)=2/x$, and Abel's formula predicts $W(x)=C/x^2$. Direct computation, with $y_2'=\dfrac{(-ax-1)e^{-ax}}{x^2}$ obtained from $y_1'$ by $a\to-a$, gives
\[ W = y_1y_2'-y_1'y_2 = \frac{(-ax-1)-(ax-1)}{x^3} = -\frac{2a}{x^2}, \]
which is nonzero for every $a\neq0$, confirming $\{y_1,y_2\}$ is a genuine fundamental system for all $a\neq0$ — consistent with the case $a=0$ being excluded from the outset (there, $r=\pm a=0$ is a double root and the fundamental system degenerates to $\{1,\,1/x\}$).