I am trying to solve the following differential equation:
delta = -(1/r D[#, r] + D[#, {r, 2}] - # l^2/r^2) &;
DSolve[delta[
g[r]] + (B l + B^2 r^2/4) g[r] == en g[
r], g[r], r]
The solution proposed by Mathematica is okay yet one can find an alternative, less complex representation with Whittaker functions. Is it possible to force Mathematica to use a certain type of function as a solution of a differential equation? We do not impose any boundary conditions.
In this specific problem one can always use a transformation rule for the confluent hypergeometric function, for instance
rule = HypergeometricU[a_, b_, z_] ->
E^(z/2) z^(-b/2) WhittakerW[b/2 - a, (b - 1)/2, z];
but this is just a workaround. Perhaps there is a more elegant way.
Edit
For instance, consider the harmonic oscillator equation
DSolve[-y''[x] == y[x], y[x], x]
{{y[x] -> C[1] Cos[x] + C[2] Sin[x]}}
Is it possible to force a solution with exponential functions? Of course, the replacement rule can be used but perhaps there is a deeper solution.
{{y[x] -> C[1] Exp[I x] + C[2] Exp[-I x]}}
It would be great if Mathematica could provide a list of exemplary solutions (but this is just wishful thinking:-).
FullSimplify[DSolve[…], TransformationFunctions -> {Automatic, # /. rule &}]
doesn't return solution with WhittakkerW. (Though I personally don't have any experience with this option.) $\endgroup$rule
works fine and it might be easily demeonstrated that's true, however the system finds a combination ofLaguerreL
andWhittakerW
more complicated than combnations of hypergeometric functions withPochhammer
. $\endgroup$Collect[TrigToExp[C[1] Cos[x] + C[2] Sin[x]], E^(I x)]
, but in general it depends on case by case basis. $\endgroup$DSolve
. Your "workaround" of explicitly applying the desired transformation rule is probably the best solution. $\endgroup$