# Gauge transformation of differential equations I

This is a follow-up question to Gauge transformation of differential equations. . Let $$y(x)$$ be a solution to the following ODE: $$\begin{eqnarray} y^{''}(x) + a_1(x) y^{'}(x)+a_0(x) y(x)=0 \end{eqnarray}$$ Now define: $$$$g(x):= \frac{y(x)+ r(x) y^{'}(x)}{r(x) \sqrt{a_0(x)} \exp(-1/2 \int a_1(x) dx)}$$$$ where $$$$r^{'}(x) + 1 - a_1(x) r(x)=0$$$$ Then: $$\begin{eqnarray} &&g^{''}(x) + \\ &&\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \frac{1}{4} \left(\frac{2 a_0''(x)}{a_0(x)}+\frac{a_0'(x) \left(\frac{4}{r(x)}-2 a_1(x)\right)}{a_0(x)}-\frac{3 a_0'(x)^2}{a_0(x)^2}+4 a_0(x)+2 a_1'(x)+\frac{8 a_1(x)}{r(x)}-a_1(x)^2-\frac{8}{r(x)^2}\right)g(x)=0 \end{eqnarray}$$

In[7]:=
Clear[a0]; Clear[a1]; Clear[y]; Clear[r]; Clear[g]; Clear[m]; x =.; \
x0 =.;
r[x_] = Exp[Integrate[a1[x], x]] C[1] -
Exp[Integrate[a1[x], x]] Integrate[ Exp[-Integrate[a1[x], x]], x];
Simplify[r'[x] + 1 - a1[x] r[x]]
g[x_] = (y[x] + r[x] y'[x])/(
r[x] Sqrt[a0[x]] Exp[-1/2 Integrate[a1[x], x]]);
Collect[(g''[x] +
1/4 (4 a0[x] + Derivative[1][a0][x]/a0[x] (4/r[x] - 2 a1[x]) - (
3 Derivative[1][a0][x]^2)/a0[x]^2 + (
2 (a0^\[Prime]\[Prime])[x])/a0[x] - a1[x]^2 + (8 a1[x])/r[x] +
2 Derivative[1][a1][x] - 8/r[x]^2) g[x]) //. {Derivative[2][y][
x] :> -a1[x] y'[x] - a0[x] y[x],
Derivative[3][y][x] :> -a1'[x] y'[x] - a1[x] y''[x] - a0'[x] y[x] -
a0[x] y'[x]}, {y[x], y'[x]}, Simplify]

Out[9]= 0

Out[11]= 0


Note that the result above can be used to generate ODEs whose solutions are known. For example let us take $$j=1$$ and $$B=C x_1$$, $$A=C x_1/x_2$$ and : $$\begin{eqnarray} a_0(x)&=& (B C - A D)^2 \frac{x^{j-1}}{4(B+A x)^2 (B-D+(A-C) x)^2(D+C x)^2}\\ a_1(x)&=& \frac{2}{x}\\ \Longrightarrow\\ r(x)&=& \frac{x^2}{x_0} +x \end{eqnarray}$$ then define: $$\begin{eqnarray} {\mathfrak P}_0&:=&x_0^2 x_2^2\\ {\mathfrak P}_1&:=&2 x_0 x_2 \left(x_2-4 C^2 x_1 (x_0 (x_1+x_2)-x_1 x_2)\right)\\ {\mathfrak P}_2&:=&x_2^2-8 C^2 x_0 \left(x_0 \left(x_1^2+5 x_1 x_2+x_2^2\right)-x_1 x_2 (x_1+x_2)\right)\\ {\mathfrak P}_3&:=&-16 C^2 x_0 (2 x_0 (x_1+x_2)+x_1 x_2)\\ {\mathfrak P}_4&=&-8 C^2 \left(3 x_0^2+3 x_0 (x_1+x_2)+x_1 x_2\right)\\ {\mathfrak P}_5&=&-8 C^2 (3 x_0+x_1+x_2)\\ {\mathfrak P}_6&=&-8 C^2 \end{eqnarray}$$ then we have: $$$$g(x):= x\cdot \frac{y(x)+ r(x) y^{'}(x)}{r(x) \sqrt{a_0(x)}}$$$$ Since from my answer to Looking for closed form solutions to linear ordinary differential equations with time dependent coefficients. we know that $$y(x)$$ is expressed through hypergeometric functions we automaticaly know the solution to the following rather complicated ODE: $$\begin{eqnarray} g^{''}(x) + \left( \frac{\sum_{j=0}^6 {\mathfrak P}_j x^j}{4 C^2 x^2 (x+x_0)^2 (x+x_1)^2 (x+x_2)^2}\right) g(x)=0 \end{eqnarray}$$

Again my question in here would be find other cases where we can find close form solutions to ODEs which are too complicated to be handled using other methods.

Here is another example which is a generalization of Example 1.3 in page 5 in https://arxiv.org/pdf/1606.01576.pdf .

Let $$a$$,$$b$$,$$c$$,$$a_1$$,$$a_2$$,$$a_3$$,$$b_2$$,$$b_4$$ and $$A$$ be real parameters. Then let: $$\begin{eqnarray} a_3&:=&-2 a A^2 b_2\\ b_4&:=&-A^2 b_2 \end{eqnarray}$$

Now define: $$\begin{eqnarray} p_0&:=&a_1 (a_1-2 b_2 (c-1))\\ p_1&:=&a_2 (2 a_1-2 b_2 c+b_2)\\ p_2&:=&a_2^2-2 A^2 b_2 (a_1 (a-b+1)+2 a b_2 (b-c))\\ p_3&:=&A^2 a_2 b_2 (-2 a+2 b-1) \end{eqnarray}$$ and $$\begin{eqnarray} P_0&:=&a_1 (2 c-3) (a_1-2 b_2 (c-1))\\ P_1&:=&2 a_2 (c-2) (2 a_1-2 b_2 c+b_2)\\ P_2&:=&A^2 \left(a_1^2 (-2 a-2 b+1)+2 a_1 b_2 (3 a+4 b c-7 b-3 c+6)-4 a b_2^2 (2 c-5) (b-c)\right)+a_2^2 (2 c-5)\\ P_3&:=&2 A^2 a_2 (b_2 (5 a+4 b c-7 b-3 c+4)-2 a_1 (a+b-1))\\ P_4&:=&A^2 (2 a+2 b-3) \left(2 A^2 b_2 (a_1 (a-b+1)+2 a b_2 (b-c))-a_2^2\right)\\ P_5&:=&2 A^4 a_2 b_2 (2 a-2 b+1) (a+b-2) \end{eqnarray}$$ and $$\begin{eqnarray} Q_0&:=&a_1 (2 c-3) (a_1-2 b_2 (c-1))\\ Q_1&:=&a_2 (2 c-3) (3 a_1+b_2 (2-4 c))\\ Q_2&:=&A^2 \left((2 a-1) a_1^2 (2 b-1)-2 a_1 b_2 (a (4 b (c-2)+4 c-3)-4 b c+7 b+3 c-6)-12 a b_2^2 (2 c-3) (b-c)\right)+4 a_2^2 (c-2)\\ Q_3&:=&A^2 a_2 (a_1 (a (8 b-6)-6 b+3)+2 b_2 (a (-4 b c+2 b-2 c+9)+2 (2 b-1) (2 c-3)))\\ Q_4&:=&-2 A^2 \left((2 a-1) A^2 (2 b-3) b_2 (a_1 (a-b+1)+2 a b_2 (b-c))+2 a_2^2 (a (-b)+a+b-1)\right)\\ Q_5&:=&2 (1-a) A^4 a_2 (2 b-3) b_2 (2 a-2 b+1) \end{eqnarray}$$ and $$$$y(x):=F_{2,1}\left[a,b,c,A^2 x^2\right]$$$$

Then the ODE: $$\begin{eqnarray} g^{''}(x) - \frac{\sum\limits_{j=0}^5 P_j x^j}{x(A x-1)(A x+1) (\sum\limits_{j=0}^3 p_j x^j)} g^{'}(x) + \frac{\sum\limits_{j=0}^5 Q_j x^j}{x^2(A x-1)(A x+1) (\sum\limits_{j=0}^3 p_j x^j)} g(x)=0 \end{eqnarray}$$ is solved by $$\begin{eqnarray} g(x)&:=& (a_3 x^3+a_2 x^2+a_1 x) y(x) + (b_4 x^4+b_2 x^2) y^{'}(x) \end{eqnarray}$$

In[14]:= a =.; b =.; c =.; a1 =.; a2 =.; a3 =.; b2 =.; b4 =.; A =.; x \
=.;
p0 =.; p1 =.; p2 =.; p3 =.;
P0 =.; P1 =.; P2 =.; P3 =.; P4 =.; P5 =.;
Q0 =.; Q1 =.; Q2 =.; Q3 =.; Q4 =.; Q5 =.; Clear[y];
{a3, b4} = {-2 a A^2 b2, -A^2 b2};
{p0, p1, p2, p3} = {a1 (a1 - 2 b2 (-1 + c)), a2 (2 a1 + b2 - 2 b2 c),
a2^2 - 2 A^2 b2 (a1 (1 + a - b) + 2 a b2 (b - c)),
A^2 a2 (-1 - 2 a + 2 b) b2};
{P0, P1, P2, P3, P4, P5} = {a1 (a1 - 2 b2 (-1 + c)) (-3 + 2 c),
2 a2 (-2 + c) (2 a1 + b2 - 2 b2 c),
a2^2 (-5 + 2 c) +
A^2 (a1^2 (1 - 2 a - 2 b) - 4 a b2^2 (b - c) (-5 + 2 c) +
2 a1 b2 (6 + 3 a - 7 b - 3 c + 4 b c)),
2 A^2 a2 (-2 a1 (-1 + a + b) + b2 (4 + 5 a - 7 b - 3 c + 4 b c)),
A^2 (-3 + 2 a + 2 b) (-a2^2 +
2 A^2 b2 (a1 (1 + a - b) + 2 a b2 (b - c))),
2 A^4 a2 (1 + 2 a - 2 b) (-2 + a + b) b2};
{Q0, Q1, Q2, Q3, Q4, Q5} = {a1 (a1 - 2 b2 (-1 + c)) (-3 + 2 c),
a2 (3 a1 + b2 (2 - 4 c)) (-3 + 2 c),
4 a2^2 (-2 + c) +
A^2 ((-1 + 2 a) a1^2 (-1 + 2 b) - 12 a b2^2 (b - c) (-3 + 2 c) -
2 a1 b2 (-6 + 7 b + 3 c - 4 b c +
a (-3 + 4 b (-2 + c) + 4 c))),
A^2 a2 (a1 (3 - 6 b + a (-6 + 8 b)) +
2 b2 (2 (-1 + 2 b) (-3 + 2 c) +
a (9 + 2 b - 2 c - 4 b c))), -2 A^2 (2 a2^2 (-1 + a + b -
a b) + (-1 + 2 a) A^2 (-3 + 2 b) b2 (a1 (1 + a - b) +
2 a b2 (b - c))),
2  A^4 a2 (1 + 2 a - 2 b) (1 - a) (-3 + 2 b) b2};
y[x_] = Hypergeometric2F1[a, b, c, (A x)^2];
eX = (D[#, {x, 2}] - (
P5 x^5 + P4 x^4 + P3 x^3 + P2 x^2 + P1 x^1 + P0)/(
x (-1 + A x) (1 + A x) (p3 x^3 + p2 x^2 + p1 x^1 + p0))
D[#, x] + (Q5 x^5 + Q4 x^4 + Q3 x^3 + Q2 x^2 + Q1 x^1 + Q0)/(
x ^2 (-1 + A x) (1 + A x) (p3 x^3 + p2 x^2 + p1 x^1 +
p0)) #) & /@ {(a3 x^3 + a2 x^2 + a1 x) y[
x] + (b4 x^4 + b2 x^2) y'[x]};

{a, b, c, a1, a2, b2, A, x} =
RandomReal[{0, 1}, 8, WorkingPrecision -> 50];
Simplify[eX]

Out[25]= {0.*10^-48}


Update: The ODE above is a seven parameter family. Now, note that if in the example above we add three additional constraints and as such reduce the number of adjustable parameters to four we get another neat example:

Firstly define: $$\begin{eqnarray} a_1&:=& c-\frac{1}{2}\\ a_2&:=& A \frac{1}{\sqrt{2}} \sqrt{-1+4 a+8 a^2+2 c-8 a c}\\ a_3&:=&-2 a A^2\\ \hline \\ b_2&:=& 1\\ b_4&:=&-A^2 \\ \hline \\ b&:=&a+\frac{1}{2} \end{eqnarray}$$ Then the ODE below: $$\begin{eqnarray} &&\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!g^{''}(x) + \frac{3-2 c+4 a A^2 x^2}{x(A x-1)(A x+1)} g^{'}(x) + \frac{(-3+2 c) + \sqrt{2} A \sqrt{-1+4 a+8 a^2+2 c-8 a c} x+2(-1-a+2 a^2) x^2}{x^2(A x-1)(A x+1)} g(x)=0 \end{eqnarray}$$ is solved by $$\begin{eqnarray} g(x)&:=& (a_3 x^3+a_2 x^2+a_1 x) y(x) + (b_4 x^4+b_2 x^2) y^{'}(x) \end{eqnarray}$$

In[18]:= a =.; b =.; c =.; a1 =.; a2 =.; a3 =.; b2 =.; b4 =.; A =.; x \
=.;
{a1, a2, a3} = {(-(1/2) + c),
A  Sqrt[1/2 (-1 + 4 a + 8 a^2 + 2 c - 8 a c)], -2 a A^2};
{b2, b4} = {1, -A^2};
b = a + 1/2;
y[x_] = Hypergeometric2F1[a, b, c, (A x)^2];
eX = (D[#, {x, 2}] + (3 - 2 c + 4 a A^2 x^2)/(x (-1 + A x) (1 + A x))
D[#, x] + ( (-3 + 2 c) +
Sqrt[2] A Sqrt[(-1 + 4 a + 8 a^2 + 2 c - 8 a c)] x +
2 (-1 - a + 2 a^2) A^2  x^2)/(
x ^2 (-1 + A x) (1 + A x)) #) & /@ {(a3 x^3 + a2 x^2 + a1 x) y[
x] + (b4 x^4 + b2 x^2) y'[x]};
{b2, a, c, A, x} = RandomReal[{0, 1}, 5, WorkingPrecision -> 50];
Simplify[eX]

Out[25]= {0.*10^-49}


Secondly define: $$\begin{eqnarray} a_1&:=& 2c-1\\ a_2&:=& A \sqrt{2} \sqrt{(-1+2 a)(-1+b)}\\ a_3&:=&-2 a A^2\\ \hline \\ b_2&:=& 1\\ b_4&:=&-A^2 \\ \hline \\ c&:=&\frac{3}{2} \end{eqnarray}$$ Then the ODE below: $$\begin{eqnarray} &&\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!g^{''}(x) + \frac{3+2 A^2(-2+a+b)x^2}{x(A x-1)(A x+1)} g^{'}(x) + \frac{-3-\sqrt{2} A \sqrt{(-1+2 a)(-1+b)} x+2(-1+a)(-3+2 b) A^2 x^2}{x^2(A x-1)(A x+1)} g(x)=0 \end{eqnarray}$$ is solved by $$\begin{eqnarray} g(x)&:=& (a_3 x^3+a_2 x^2+a_1 x) y(x) + (b_4 x^4+b_2 x^2) y^{'}(x) \end{eqnarray}$$

In[567]:= a =.; b =.; c =.; a1 =.; a2 =.; a3 =.; b2 =.; b4 =.; A =.; \
x =.;
{b2, b4} = {1, -A^2};
{a1, a2, a3} = {2 (c - 1),
Sqrt[2] Sqrt[-1 + 2 a] A Sqrt[-1 + b], -2 a A^2};
c = 3/2;
y[x_] = Hypergeometric2F1[a, b, c, (A x)^2];
eX = (D[#, {x, 2}] + (3 + 2 A^2 (-2 + a + b) x^2)/(
x (-1 + A x) (1 + A x))
D[#, x] + ( -3 - Sqrt[2] A (Sqrt[-1 + 2 a] Sqrt[-1 + b]) x +
2 (-1 + a) (-3 + 2 b) A^2 x^2)/(
x^2 (-1 + A x) (1 + A x)) #) & /@ {(a3 x^3 + a2 x^2 + a1 x) y[
x] + (b4 x^4 + b2 x^2) y'[x]};
{a, b, A, x} = RandomReal[{0, 1}, 4, WorkingPrecision -> 50];
Simplify[eX]

Out[574]= {0.*10^-47 + 0.*10^-49 I}


You can think further about e.g. the effect the below approach apply on HEUN-type ODEs, or some superposition approaches with e.g. Solutions in terms of the hypergeometric functions etc.

Hopefully someone can get challenge on some quite advanced ODEs like:

$$\dfrac{d^2u}{dr^2}+\left(\dfrac{1}{2(r+1)}+\dfrac{1}{2(r-1)}-\dfrac{1}{r^2}\right)\dfrac{du}{dr}-\dfrac{k_2}{2k_1^2}\left(\dfrac{1}{r+1}+\dfrac{1}{r-1}\right)u=0$$

$$\dfrac{d^2y}{ds^2}+\left(\dfrac{1}{2(s-6)}+\dfrac{1}{2(s+6)}-\dfrac{1}{s}\right)\dfrac{dy}{ds}+\left(\dfrac{6A-B}{2(s-6)}-\dfrac{6A+B}{2(s+6)}+A\right)y=0$$ , $$A\neq0$$

$$\dfrac{d^2f}{dr^2}+\left(\dfrac{2r}{r^2+1}-\dfrac{1}{\omega(r^2+1)^2}\right)\dfrac{df}{dr}-\dfrac{f}{\omega^2(r^2+1)^2}=0$$

and so on