2
$\begingroup$

I was trying to solve a system of differential equations in Mathematica and had troubles understanding what the solution looked like. So I wanted help to unpack it.

I had a system of two coupled differential equations y1[x] , y2[x] and the solution Mathematica spits out is the following

{{y2 -> Function[{x}, 
    C[1] InverseFunction[
       Inactive[Integrate][
         1/((Conjugate[K[1]] - C[1] Conjugate[C[1] K[1]]) K[1]^2), {K[
           1], 1, #1}] &][-((I x α)/ℏ) + C[2]]], 
  y1 -> Function[{x}, 
    InverseFunction[
      Inactive[Integrate][
        1/((Conjugate[K[1]] - C[1] Conjugate[C[1] K[1]]) K[1]^2), {K[
          1], 1, #1}] &][-((I x α)/ℏ) + C[2]]]}}

I do not understand function, inverse function, and inactive integrate methods. I was wondering how can I understand the solutions qualitatively and quantitatively.

EDIT : The original code about the two differential equations :

eq1 = I*ℏ*
   D[y1[x], x] - α*(Conjugate[y1[x]]*y1[x] - Conjugate[y2[x]]*y2[x])*
   y1[x]
eq2 = I*ℏ*
   D[y2[x], x] - α*(Conjugate[y1[x]]*y1[x] - Conjugate[y2[x]]*y2[x])*
   y2[x] 
eqns = {eq1 == 0, eq2 == 0};
$\endgroup$
6
  • $\begingroup$ Please post your original code about two coupled differential equations. $\endgroup$
    – cvgmt
    Aug 4, 2021 at 0:19
  • $\begingroup$ Let us rewrite eq1 = I*\[HBar]*D[y1[x], x] - \[Alpha]*(Abs[y1[x]]^2 - Abs[y2[x]]^2)* y1[x] eq2 = I*\[HBar]*D[y2[x], x] - \[Alpha]*(Abs[y1[x]]^2 - Abs[y2[x]]^2)* y2[x] through Abs, then the solutions are $\endgroup$
    – user64494
    Aug 4, 2021 at 5:06
  • $\begingroup$ {{y2[x] -> C[1] InverseFunction[ Inactive[Integrate][ 1/((Abs[K[1]] - Abs[C[1] K[1]]) (Abs[K[1]] + Abs[C[1] K[1]]) K[1]), {K[1], 1, #1}] &][-(( I x \[Alpha])/\[HBar]) + C[2]], y1[x] -> InverseFunction[ Inactive[Integrate][ 1/((Abs[K[1]] - Abs[C[1] K[1]]) (Abs[K[1]] + Abs[C[1] K[1]]) K[ 1]), {K[1], 1, #1}] &][-((I x \[Alpha])/\[HBar]) + C[2]]}} $\endgroup$
    – user64494
    Aug 4, 2021 at 5:11
  • 1
    $\begingroup$ I think the system of ODEs under consideration should be solved numerically by ParametricNDSolve. $\endgroup$
    – user64494
    Aug 4, 2021 at 5:16
  • 1
    $\begingroup$ In solving DEs, DSolve often has to integrate (obviously) an equation. Sometimes the integral cannot be solved. So it ends up with an equation $F(x,y)=0$ in terms of an integral that is inactivated because it couldn’t be solved. Next DSolve tries to solve for $y$. If the equation is of the form $x = f(y)$, we get $y = f^{-1}(x)$. If $f^{-1}$ cannot be computed (usually can’t when it involves an inactive integral), we $y$ in terms of an inverse function. $\endgroup$
    – Michael E2
    Aug 4, 2021 at 15:24

2 Answers 2

2
$\begingroup$

To answer the question about the form of the solution:

In solving DEs, DSolve often has to integrate (obviously) an equation. Sometimes the integral cannot be solved. So it ends up with an equation $F ( x , y ) = 0$ in terms of an integral that is inactivated because it couldn’t be solved. Next DSolve tries to solve for $y$. If the equation is of the form $x = f ( y )$, we get $y = f^{ − 1} ( x )$. If $f^{ − 1}$ cannot be computed (usually can’t when it involves an inactive integral), we get solution for $y$ in terms of an inverse function.

Here's a way to unwind the steps to get the solution in implicit form, still in terms of an unevaluated integral. We'll transform the expressions with three or four replacement rules. The last rule is optional.

(* Convert y -> Function[{x}, a] to y[x] == a *)
{HoldPattern[dv_ -> Verbatim[Function][{iv__}, body_]] :> dv[iv] == body} 

(* Solve each equation for the InverseFunction[..][..] in it *)
{eq_Equal :> First@ Solve[eq, Cases[eq, _InverseFunction[_], Infinity]]}

(* Rewrite  $f^{-1}(a) \rightarrow z$  as  $f(z) = a$  *)
{{Verbatim[InverseFunction][f_][a_] -> z_} :> f[z] == a}

(* Change dummy variable K[1] to something more traditional *)
{K[1] -> ξ}

Apply the rules in succession with ReplaceAll (/.):

sol /.
    {HoldPattern[dv_ -> Verbatim[Function][{iv__}, body_]] :> 
      dv[iv] == body} /.
   {eq_Equal :> 
     First@ Solve[eq, Cases[eq, _InverseFunction[_], Infinity]]} /.
  {{Verbatim[InverseFunction][f_][a_] -> z_} :>
     f[z] == a} /.
 {K[1] -> ξ}
$\endgroup$
1
$\begingroup$

Trying to solve a Cauchy problem by

ClearAll["Global`*"];
eq1 = I*\[HBar]*D[y1[x],x] - \[Alpha]*(Conjugate[y1[x]]*y1[x] - Conjugate[y2[x]]*y2[x])*y1[x];
eq2 = I*\[HBar]* D[y2[x],x] - \[Alpha]*(Conjugate[y1[x]]*y1[x] - Conjugate[y2[x]]*y2[x])* y2[x];
eqns = {eq1 == 0, eq2 == 0, y1[1] == I, y2[1] == 2};
DSolve[eqns, {y1, y2}, x]

, I obtain {} and a warning "DSolve::bvnul: "For some branches of the general solution, the given boundary conditions lead to an empty solution."" The same with other initial values.

The ParametricNDSolve command succeeds:

\[HBar] = 1; \[Alpha] = 2;
eqns = {eq1 == 0, eq2 == 0, y1[1] == a, y2[1] == b};
sol = ParametricNDSolve[eqns, {y1, y2}, {x, 1, 2}, {a, b}];
y1 = y1[I, 2] /. sol;
y1[1.5] /. sol

-0.14112 - 0.989992 I

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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