Solution of non-homogeneous second-order differential equation with time dependent coefficients I am having difficulty understanding how to solve this differential equation:
$$ \ddot x+\frac{\dot a(t)}{a(t)}\dot x+b^{2}(t)x=-\frac{1}{a(t)}k$$
where $a(t)$ and $b(t)$ are time-dependent coefficients and $k$ is a constant. Could you give me some advice? I think I have to use Wronskian but I can't solve it anyway. I hope I have expressed myself clearly and thank you in advance for your help.
 A: Assume that $$[r(x'+px)]'=q$$, and let it be our 2nd order equation. Then
$$x''+(p+r'/r)x'+((rp)'/r)x=q/r$$ Then $$q/r= -k/a; \\ (rp)'=rb^2;\\p+r'/r=a'/a$$ Thus,
$$r=-aq/k$$
$$p=\frac{1}{aq}\int aqb^2,$$ and we need to solve for q in $$\frac{\int aqb^2}{aq}+\frac{(aq)'}{aq}=\frac{a'}{a}.$$
$$\int aqb^2+(aq)'=a'q$$
$$b^2q+(a'/a)q'+q''=0:$$ In other words, $$x=e^{-\int P}\left(\int \frac{-ke^{-\int P}\left[\int q+C_0\right]}{aq}+C_1\right)$$ and $$q''+\frac{a'}{a}q'+b^2q=0.$$ Now, $q''+\frac{a'}{a}q'+b^2q=0$ is essentially as general as
$$\ddot{y}+A(t)\dot{y}+B(t)y=0,$$ so good luck! The constants are already accounted for, so you don't need to worry about obtaining the general solution for $y$ (or $q$).
A: If you make the substitution (inspired by the so-called "Ranz transformation" of mixing theory - see https://aiche.onlinelibrary.wiley.com/doi/pdfdirect/10.1002/aic.690250105)
$$ u = \int_0^t \frac{dt'}{a(t')} $$
you'll obtain
$$ \frac{d^2 x}{du^2} + b^2 a^2 x + k a(u) = 0$$
which is still hard to solve -- a driven harmonic oscillator with a variable frequency. Now you're in the realm of driven non-linear oscillators and perturbation theory is there for you, but analytical solutions are likely not.
