# Problem solving first order ODE's with DSolve

The issue I am facing is the following. I am trying to solve a system of two coupled first order ODE's with DSolve:

eqns = {A*f'[x] == -x*f[x]/2 + B*g[x], A*g'[x] == x*g[x]/2 + B*f[x]};
DSolve[eqns, {f[x], g[x]}, x]


As output this just gives the same command, which from what I gather means that DSolve cannot solve it.

But if I just explicitly substitute the equations into one another, then suddenly it can be solved:

fun = f[x] /. Solve[A*g'[x] == x*g[x]/2 + B*f[x], f[x]];
dfun = D[fun, x];
DSolve[A*f'[x] == -x*f[x]/2 + B*g[x] /. {f[x] -> fun, f'[x] -> dfun},
g[x], x]


This gives

{{g[x] ->
C[2] ParabolicCylinderD[B^2/A, (I x)/Sqrt[A]] +
C[1] ParabolicCylinderD[(-A - B^2)/A, x/Sqrt[A]]}}


This makes me think that I'm simply doing something wrong in the first line, which is probably some silly notation mistake. If someone would be able to help me out, I'd be very thankful.

• Nothing wrong with what you did; only that DSolve[] is not sufficiently smart to recognize that the problem can be manipulated to something solvable. – J. M.'s discontentment Mar 22 '19 at 13:12
• Hm, I see. Well, that's okay I suppose! Thank you. What does one do with the question in this case? I'll look around in the meta part of the site a bit to figure that out, but perhaps it comes up more often. – user129412 Mar 22 '19 at 13:14
• You could try reporting this example to Wolfram support; then maybe a future version of DSolve[] will be smarter than the current version. ;) – J. M.'s discontentment Mar 22 '19 at 13:16
• I tried with Mathematica 12.0 and can't solve :( – Mariusz Iwaniuk Apr 12 '19 at 16:26