Does this ODE question have closed form solution?

Here's a nifty trick - you can transform any linear $n$th-order (in)homogeneous ordinary differential equation into a linear $1$st-order (in)homogeneous $n$-dimensional system of ODEs, which can be solved with the power of matrix exponentials. Behold:

Write $v=y'$, and reinterpret the differential equation as a first-order system:

$$\begin{pmatrix} y \\ v \end{pmatrix}' = \begin{pmatrix}0 & 1\\ -2(c+e^{A+Bx}) & 2a(b-x)\end{pmatrix} \begin{pmatrix} y \\ v \end{pmatrix}.$$

If we denote the column vector $(y,v)^T$ as $\vec{y}$, we can write this system as $\vec{y}'=P(x)\vec{y}$. The solution is actually the same as in the $1$-dimensional case, but you need the matrix exponential,

$$\vec{y} = \exp\left(\int_{x_0}^x P(\tau)d\tau\right) \vec{y}_0 $$ $$= \exp \begin{pmatrix}0 & x-x_0\\ \frac{2}{B}e^A(e^{Bx_0}-e^{Bx})+2c(x_0-x) & 2ab(x-x_0)+a(x_0^2-x^2)\end{pmatrix} \vec{y}_0. $$

Before we actually attempt to synthesize the incoming monstrosity, let's prepare ourselves by writing this matrix using variables: $\begin{pmatrix} 0 & \alpha \\ \beta & \gamma\end{pmatrix}$. Because, let's face it, the full analytical solution is going to be insanely complicated. Also, we are going to do it using the Putzer Algorithm (just keep in mind that we need to distinguish between $x$ and $t$; while using this method we must fix $x$). The eigenvalues are $\lambda_{1,2} = (\gamma\pm\sqrt{\gamma^2+4\alpha\beta})/2$. Solving for $p_1$ and $p_2$ using generic methods, and plugging them into the formula with $t=1$, we get

$$\vec{y}=\left[ \begin{pmatrix} e^{\lambda_1} & 0 \\ 0 & e^{\lambda_2}\end{pmatrix} +\frac{e^{\lambda_1}-e^{\lambda_2}}{\lambda_1-\lambda_2} \begin{pmatrix} -\lambda_1 & \alpha \\ \beta & \gamma-\lambda_1 \end{pmatrix}\right]\vec{y}_0.$$

Just remember the $y$ you want is the first component of $\vec{y}$, and that $\lambda_{1,2}$ are functions of $\alpha,\beta,\gamma$, and that $\alpha,\beta,\gamma$ are all functions of $x$, so this technically contains your full analytical solution, just with a lot of substitutions. Have fun with your research OP. :)


Maple doesn't find a closed-form solution, so I suspect there isn't any (other than the trivial $f=0$). Here are the first few terms of some series solutions: with $f(0)=1$, $f'(0)=0$, $f(x) = 1+ \left( c+{{\rm e}^{A}} \right) {x}^{2}+ \left( -2/3\,abc-2/3\,ab{{\rm e}^{A}}+1/3\,{{\rm e}^{A}}B \right) {x} ^{3}$

$~~~~~~~~~~~+(~1/6\,{c}^{2}+1/3\,c{{\rm e}^{A}}+1/6\, \left( {{\rm e}^{A }} \right) ^{2}+1/3\,{a}^{2}{b}^{2}c+1/3\,{a}^{2}{b}^{2}{{\rm e}^{A}}- 1/6\,ab{{\rm e}^{A}}B+1/3\,ac+1/3\,a{{\rm e}^{A}}$

$~~~~~~~~~~~+1/12\,{{\rm e}^{A}}{ B}^{2}~) {x}^{4}+ ( 2/15\,{{\rm e}^{A}}Bc+2/15\, ( { {\rm e}^{A}} ) ^{2}B+{\frac {1}{60}}\,{{\rm e}^{A}}{B}^{3}-2/15 \,ab{c}^{2}-{\frac {4}{15}}\,cab{{\rm e}^{A}}$

$~~~~~~~~~~~-2/15\,ab ( {{\rm e} ^{A}} ) ^{2}-2/15\,{a}^{3}{b}^{3}c-2/15\,{a}^{3}{b}^{3}{{\rm e}^ {A}}+1/15\,{a}^{2}{b}^{2}{{\rm e}^{A}}B-1/3\,{a}^{2}bc-1/3\,{a}^{2}b{ {\rm e}^{A}}$

$~~~~~~~~~~~-1/30\,ab{{\rm e}^{A}}{B}^{2}+1/10\,a{{\rm e}^{A}}B ) {x}^{5}+O( {x}^{6}) $

With $f(0)=0$, $f'(0)=1$:

$f(x) = x-ab{x}^{2}+ \left( 2/3\,{a}^{2}{b}^{2}+1/3\,a+1/3\,c+1/3\,{{\rm e}^{A}} \right) {x}^{3}$

$+\left( -1/3\,abc-1/3\,ab{ {\rm e}^{A}}-1/3\,{a}^{3}{b}^{3}-1/2\,{a}^{2}b+1/6\,{{\rm e}^{A}}B \right) {x}^{4}$

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