I think I have solved this ODE (I didn't verify the solution). The problem with DSolve
is Integrate
was not terminating for this inhomogeneous equation.
So what I did was solve the homogeneous equation, then applied variation of parameters described here:
homode = -16c*m^2Cos[x]k[x] - c(Sin[3x] - 7Sin[x])k'[x] + 4c*Cos[x]Sin[x]^2k''[x] == 0;
homsol = First[k[x] /. DSolve[homode, k[x], x]];
u1 = homsol /. {C[1] -> 1, C[2] -> 0};
u2 = homsol /. {C[1] -> 0, C[2] -> 1};
f = m^2(3 + 4m Cos[x] + Cos[2x])Tan[x/2]^(2m)Cos[x]Sin[x]^2/(4c*Cos[x] Sin[x]^2);
W = Wronskian[homode, k, x];
A = -HoldForm[Integrate[#, x]]&[u2*f/W];
B = HoldForm[Integrate[#, x]]&[u1*f/W];
TraditionalForm[k[x] == u1 C[1] + u2 C[2] + A u1 + B u2]
#--- Edit ---
--- Edit ---
I have verified this solution is correct and I thought I'd share because this is the first time I've found a real use for Inactive
over Hold
... exciting!
So instead of using HoldForm
to hold A
and B
, I use Inactivate
:
A = Inactivate[-Integrate[u2*f/W, x], Integrate];
B = Inactivate[Integrate[u1*f/W, x], Integrate];
final = u1 C[1] + u2 C[2] + A u1 + B u2;
FullSimplify[testk /. {k[x] -> final, k'[x] -> D[final, x], k''[x] -> D[final, {x, 2}]}]
True