Consider y'' + ay' + by = f(x), λ := 4b - a^2 > 0 . Show…
Consider $y'' + ay' + by = f(x), \qquad \lambda := 4b - a^2 > 0$. Show that the general solution can be written $y = Ae^{-\frac{a}{2}x}\sin\!\Big(\tfrac{\sqrt\lambda}{2}(x-B)\Big) + \frac{2}{\sqrt\lambda}\int_{x_0}^{x} f(t)\,e^{\frac{a}{2}(t-x)}\sin\!\Big(\tfrac{\sqrt\lambda}{2}(x-t)\Big)\,dt$.
Explanation of Method
Variation of parameters, a collapsing Wronskian, and a Green's-function check via Leibniz's rule
Step 1: The underdamped homogeneous solution
The condition $\lambda = 4b-a^2>0$ makes the discriminant of $r^2+ar+b=0$ negative, so the roots are the complex conjugate pair
\[ r = -\frac{a}{2} \pm i\,\frac{\sqrt\lambda}{2}. \]
The homogeneous solution is therefore oscillatory with exponential envelope, $y_h = e^{-ax/2}\Big(C_1\cos\tfrac{\sqrt\lambda}{2}x + C_2\sin\tfrac{\sqrt\lambda}{2}x\Big)$.
Any combination $C_1\cos\theta+C_2\sin\theta$ can be written as $A\sin(\theta-B)$ for suitable amplitude $A=\sqrt{C_1^2+C_2^2}$ and phase $B$ (since $A\sin(\theta-B)=A\cos B\sin\theta - A\sin B\cos\theta$, matching $C_1=-A\sin B$, $C_2=A\cos B$). With $\theta=\tfrac{\sqrt\lambda}{2}x$ this gives the amplitude–phase form
\[ y_h = A\,e^{-ax/2}\sin\!\Big(\tfrac{\sqrt\lambda}{2}(x-B)\Big), \]
which is exactly the first term of the claimed solution.
Step 2: A particular solution by variation of parameters
Take as the fundamental pair
\[ y_1 = e^{-ax/2}\cos\tfrac{\sqrt\lambda}{2}x, \qquad y_2 = e^{-ax/2}\sin\tfrac{\sqrt\lambda}{2}x. \]
Differentiating, \[y_1' = e^{-ax/2}\Big(-\tfrac{a}{2}\cos\tfrac{\sqrt\lambda}{2}x - \tfrac{\sqrt\lambda}{2}\sin\tfrac{\sqrt\lambda}{2}x\Big), \qquad y_2' = e^{-ax/2}\Big(-\tfrac{a}{2}\sin\tfrac{\sqrt\lambda}{2}x + \tfrac{\sqrt\lambda}{2}\cos\tfrac{\sqrt\lambda}{2}x\Big).\]
The Wronskian collapses nicely because the $-a/2$ cross terms cancel: \[W = y_1y_2' - y_2y_1' = e^{-ax}\Big[\tfrac{\sqrt\lambda}{2}\cos^2\tfrac{\sqrt\lambda}{2}x + \tfrac{\sqrt\lambda}{2}\sin^2\tfrac{\sqrt\lambda}{2}x\Big] = \frac{\sqrt\lambda}{2}\,e^{-ax}.\]
Step 3: Assembling and simplifying the particular integral
The standard variation-of-parameters formula gives, with base point $x_0$, \[y_p = -y_1(x)\int_{x_0}^x \frac{y_2(t)f(t)}{W(t)}\,dt + y_2(x)\int_{x_0}^x \frac{y_1(t)f(t)}{W(t)}\,dt.\]
Since $1/W(t) = \frac{2}{\sqrt\lambda}e^{at}$, each integrand carries a factor $e^{at}$ that pairs with the $e^{-at/2}$ already inside $y_1,y_2$ to leave a clean $e^{at/2}$. Pulling the constant $2/\sqrt\lambda$ out front,
\[ y_p = \frac{2}{\sqrt\lambda}\int_{x_0}^x f(t)\,e^{at/2}\Big[-y_1(x)\sin\tfrac{\sqrt\lambda}{2}t + y_2(x)\cos\tfrac{\sqrt\lambda}{2}t\Big]\,dt. \]
The bracket, once $y_1(x)=e^{-ax/2}\cos\tfrac{\sqrt\lambda}{2}x$ and $y_2(x)=e^{-ax/2}\sin\tfrac{\sqrt\lambda}{2}x$ are inserted, factors as $e^{-ax/2}$ times
\[ \sin\tfrac{\sqrt\lambda}{2}x\cos\tfrac{\sqrt\lambda}{2}t - \cos\tfrac{\sqrt\lambda}{2}x\sin\tfrac{\sqrt\lambda}{2}t = \sin\!\Big(\tfrac{\sqrt\lambda}{2}(x-t)\Big), \]
by the sine-subtraction identity $\sin A\cos B-\cos A\sin B=\sin(A-B)$ with $A=\tfrac{\sqrt\lambda}{2}x$, $B=\tfrac{\sqrt\lambda}{2}t$. Combining the surviving exponentials $e^{at/2}e^{-ax/2}=e^{\frac{a}{2}(t-x)}$ gives
\[ y_p = \frac{2}{\sqrt\lambda}\int_{x_0}^x f(t)\,e^{\frac{a}{2}(t-x)}\sin\!\Big(\tfrac{\sqrt\lambda}{2}(x-t)\Big)\,dt, \]
which is precisely the integral term claimed.
Step 4: The general solution
Adding $y_h$ and $y_p$ produces the stated result: \[y = A\,e^{-\frac{a}{2}x}\sin\!\Big(\tfrac{\sqrt\lambda}{2}(x-B)\Big) + \frac{2}{\sqrt\lambda}\int_{x_0}^{x} f(t)\,e^{\frac{a}{2}(t-x)}\sin\!\Big(\tfrac{\sqrt\lambda}{2}(x-t)\Big)\,dt\]
Step 5: Verification via the Green's function kernel
Write $G(x,t) = e^{\frac{a}{2}(t-x)}\sin\!\big(\tfrac{\sqrt\lambda}{2}(x-t)\big)$, so that $y_p=\frac{2}{\sqrt\lambda}\int_{x_0}^x f(t)G(x,t)\,dt$. Two facts about $G$ drive the check: first, $G(x,x)=0$ since the sine factor vanishes; second, as a function of $x$ alone (with $t$ fixed), $G$ is itself a solution of the homogeneous equation $G_{xx}+aG_x+bG=0$, being (up to the constant $2/\sqrt\lambda$) exactly the amplitude-phase form of $y_h$ shifted by $t$. Differentiating $y_p$ once with Leibniz's rule, the boundary contribution from the upper limit vanishes because $G(x,x)=0$, leaving
\[ y_p' = \frac{2}{\sqrt\lambda}\int_{x_0}^x f(t)\,G_x(x,t)\,dt. \]
Differentiating again, the boundary term now involves $G_x(x,t)\big|_{t=x}$; direct computation from the definition of $G$ gives $G_x(x,x)=\tfrac{\sqrt\lambda}{2}$, so that boundary term contributes exactly $\frac{2}{\sqrt\lambda}\cdot\tfrac{\sqrt\lambda}{2}f(x)=f(x)$ to $y_p''$:
\[ y_p'' = f(x) + \frac{2}{\sqrt\lambda}\int_{x_0}^x f(t)\,G_{xx}(x,t)\,dt. \]
Substituting these into $y_p''+ay_p'+by_p$, every term under the integral sign combines into $G_{xx}+aG_x+bG=0$, and only the boundary contribution $f(x)$ survives: $y_p'' + ay_p' + by_p = f(x)$.
This was confirmed independently with concrete numbers — taking $a=2$, $b=3$ (so $\lambda=4\cdot3-4=8$) and constant forcing $f(t)\equiv1$, direct symbolic substitution of the resulting $y_p$ into $y''+2y'+3y$ reduces exactly to $1$, matching $f(x)$ term for term.
Result
Final answer:
\[\boxed{y = A\,e^{-\frac{a}{2}x}\sin\!\Big(\tfrac{\sqrt\lambda}{2}(x-B)\Big) + \frac{2}{\sqrt\lambda}\int_{x_0}^{x} f(t)\,e^{\frac{a}{2}(t-x)}\sin\!\Big(\tfrac{\sqrt\lambda}{2}(x-t)\Big)\,dt}\]
Remark
Remark. The kernel $G(x,t)$ built here is the causal (one-sided) Green's function of the underdamped oscillator: it encodes the impulse response, and the particular solution is simply the convolution of the forcing $f$ against it, echoing the same variation-of-parameters mechanism seen for $y''=f(x)$ in the surrounding problems.