# DSolve vs a system of differential equations

I'm trying to solve a simple system of differential equations.

dp = (D[#1, #2] + #2 #1) &;
dn = (D[#1, #2] - #2 #1) &;
DSolve[{dp[f1[x], x] == a f2[x], dn[f2[x], x] == b f1[x]}, {f1, f2},
x]


using DSolve. Unfortunately, Mathematica is not able to handle this task. Is there a way to force Mathematica to print a result? Of course, it's a simple problem one could do by hand but that's not the point:-).

-
I've contacted Wolfram, the support team forwarded the issue to the developers. I'll let you know if I find anything new. –  Gregory Rut Sep 17 '13 at 16:23

you can manually simplify the system, eliminating f1..

DSolve[dp[dn[f2[x], x]/b, x] == a f2[x], f2, x]

(*  {{f2 -> Function[{x},
C[2] ParabolicCylinderD[(a b)/2, I Sqrt[2] x] +
C[1] ParabolicCylinderD[1/2 (-2 - a b), Sqrt[2] x]]}} *)


You get that by hand??

-
Yup:-). The result is a confluent hypergeometric function. But it'd be great if Mathematica could do it by itself:-). –  Gregory Rut Sep 13 '13 at 19:28
a cheat I know but DSolve[Eliminate[Join[eqns,{D[eqns,x][[2]]}],{f1[x],f1'[x]}],f2,x] where eqns={dp[f1[x],x]==a f2[x],dn[f2[x],x]==b f1[x]}. –  chuy Sep 13 '13 at 19:44
That's a very nice cheat:-). It's practically the same as the solution provided by george2079 though. –  Gregory Rut Sep 14 '13 at 11:50
@GregoryRut I think you are the first person I've met who has associated the terms "simple problem" and "confluent hypergeometric function" –  bobthechemist Sep 14 '13 at 15:08

I'm not sure if this answers your question but a little manipulation gives the solution in terms of Hermite polynomials.

sys = {x f[x] + f'[x] == a g[x], -x g[x] + g'[x] == b f[x]};


Differentiatingthis system and eliminating first derivatives increases the order of an ODE system

sys2 = D[sys, x] /. First@Solve[sys, {f'[x], g'[x]}] // Simplify
(* => {(-1 + a b + x^2) f[x] == f''[x], (1 + a b + x^2) g[x] == g''[x]} *)


but DSolve can handle it

$$f(x) = e^{-\frac{x^2}{2}} 2^{-\frac{a b}{4}} \left(c_1 2^{\frac{a b}{2}} H_{-\frac{a b}{2}}(x)+\sqrt{2} c_2 e^{x^2} H_{\frac{1}{2} (a b-2)}(i x)\right)$$

$$g(x) = e^{-\frac{x^2}{2}} 2^{-\frac{a b}{4}} \left(c_3 2^{\frac{a b}{2}+\frac{1}{2}} H_{\frac{1}{2} (-a b-2)}(x)+c_4 e^{x^2} H_{\frac{a b}{2}}(i x)\right)$$

-
This is very similar to the solution provided by @chuy (of course, both are very nice but they do not answer my question). We're putting f'[x] and g'[x] by hand. It's like one's doing all the work for Mathematica:-). Perhaps I will need to restate my question. –  Gregory Rut Sep 15 '13 at 15:54
Yes, but this is done by Mathematica. What do you expect than? –  mmal Sep 16 '13 at 14:15
I'd expect that DSolve will be able to crack this problem by itself. A system of 2 equations is just a toy model. If you consider more equations, things will not go so smoothly anymore. Anyway, I've sent a message to Wolfram, perhaps they will be able to help us. –  Gregory Rut Sep 16 '13 at 14:22
Have you tried this differentiation/substitution trick on your objective problem? –  mmal Sep 16 '13 at 14:27
Yup, I stopped the evaluation after a few minutes. –  Gregory Rut Sep 16 '13 at 14:41