0
$\begingroup$

I have a differential equations.But mathematica dosen't work.


eq1 = a'[x] - 1/2*a[x] - 1/2*Exp[x]*b[x];

eq2 = b'[x] + 1/2*b[x] - 1/2*Exp[x]*a[x];

DSolve[{eq1 == 0, eq2 == 0}, {a[x], b[x]}, x]

But it return itself.


Out[1] = DSolve[{-(a[x]/2) - 1/2 E^x b[x] + Derivative[1][a][x] == 
   0, -(1/2) E^x a[x] + b[x]/2 + Derivative[1][b][x] == 0}, {a[x], 
  b[x]}, x]

```
$\endgroup$
3
  • $\begingroup$ That simply means that Mathematica can't find an analytical solution. Add initial conditions and use NDSolve instead. $\endgroup$
    – mattiav27
    Commented Nov 11, 2022 at 5:05
  • 1
    $\begingroup$ Maple 2022.2 answers $$\left\{a\! \left(x\right) {=} {\mathrm e}^{\frac{x}{2}} \left(\textit{_}\mathit{C1} \mathrm{BesselI}\! \left(0,\frac{{\mathrm e}^{x}}{2}\right)+\textit{_}\mathit{C2} \mathrm{BesselK}\! \left(0,\frac{{\mathrm e}^{x}}{2}\right)\right), \\ b\! \left(x\right){=}{\mathrm e}^{\frac{x}{2}} \left(\mathrm{BesselI}\! \left(1,\frac{{\mathrm e}^{x}}{2}\right) \textit{_}\mathit{C1}-\mathrm{BesselK}\! \left(1,\frac{{\mathrm e}^{x}}{2}\right) \textit{_}\mathit{C2}\right)\right\} .$$ $\endgroup$
    – user64494
    Commented Nov 11, 2022 at 6:42
  • 2
    $\begingroup$ Manually elimination of b[x] gives a solvable ode $\endgroup$ Commented Nov 11, 2022 at 7:28

1 Answer 1

2
$\begingroup$
Remove[eq1, eq2, solA, A, solB, B, a, b]
eq1 = a'[x] - 1/2*a[x] - 1/2*Exp[x]*b[x];
eq2 = b'[x] + 1/2*b[x] - 1/2*Exp[x]*a[x];

You can do this. Note that each of the expressions has a parameter, but not its derivative. From the second expression get $a[x]$:

solA = Solve[eq2 == 0, a[x]]

Then substitute this into the first ODE and solve it like one ordinary differential equation for the opposite variable (in this case for b[x]):

A = a[x] /. solA // First
ReplaceAll[eq1, {a[x] -> A, a'[x] -> D[A, x]}]
solB = DSolve[% == 0, b[x], x] // FullSimplify

Then substitute into the first equation and get a couple of solutions $A,B$:

B = ReplaceAll[A, {solB[[1]] // First, D[solB[[1]] // First, x]}] // FullSimplify

The same is done and vice versa.

Remove[eq1, eq2, solA, A, solB, B, a, b]
eq1 = a'[x] - 1/2*a[x] - 1/2*Exp[x]*b[x];
eq2 = b'[x] + 1/2*b[x] - 1/2*Exp[x]*a[x];

From the first expression get $b[x]$:

solB = Solve[eq1 == 0, b[x]]

hen substitute this into the second ODE and solve it like one ordinary differential equation for the opposite variable (in this case for a[x]):

B = b[x] /. solB // First

ReplaceAll[eq2, {b[x] -> B, b'[x] -> D[B, x]}]

solA = DSolve[% == 0, a[x], x] // FullSimplify

Then substitute into the second equation and get a couple of solutions $A,B$:

A = ReplaceAll[B, {solA[[1]] // First, D[solA[[1]] // First, x]}] // FullSimplify

The most interesting thing is that such a naive approach gives, perhaps, two pairs of solutions separately. In the figure below, the solution plots for each of the cases are symmetrical about the x-axis.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.