4
$\begingroup$

Is it possible to solve symbolically this equation for $x$: $$\exp \left(-x^2\right)=\frac{c_1}{\sqrt{c_2-c_3 x}}$$

Exp[-x^2] == c1/Sqrt[c2 - c3 x]

$c_1$, $c_2$ and $c_3$ are positive constants, with $\frac{c_1}{\sqrt{c_2}}<1$. I am interested in the negative solution, $x<0$. A typical plot of the two functions at the RHS and LHS of the equation is plot of the two sides of the equation

I tried an expansion at zero to the second order of the two sides of the equation, but the result besides being complicated does not seem to give a good approximation of the result. On the other side, it is easy to find a numerical solution to the problem:

NSolve[Exp[-x^2] == c1/Sqrt[c2 - c3 x] && x < 0, x]

Thanks in advance.

$\endgroup$
6
  • 1
    $\begingroup$ Just expand left and right hand sides to the second order and Solve. $\endgroup$
    – yarchik
    May 24 at 9:20
  • 2
    $\begingroup$ @umby It's preferable that you paste the equation as code, not as LaTeX. LaTex is difficult to copy into Mathematica. $\endgroup$ May 24 at 9:34
  • $\begingroup$ Just start with c1=1,c2=2,c3=3. Next plot right and left side of equation. They intersect at about x=-1 and x=1/4. Use the negative value in FindRoot[Exp[-x^2]==1/(Sqrt[1-2 x]},{x,-1}] to get the negative solution. $\endgroup$
    – josh
    May 24 at 9:49
  • 1
    $\begingroup$ Thanks for accepting my answer, but I think you were too hasty doing that. While accepting is one of the things to do after your question is answered, we recommend that users should test answers before voting and wait 24 hours after answers stop arriving before accepting the best one. That allows people in all timezones to answer your question and an opportunity for other users to point out alternatives, caveats or limitations of the available answers. $\endgroup$
    – rhermans
    May 24 at 11:11
  • 1
    $\begingroup$ @DanielHuber I think the OP is expecting a closed-form expression where $x$ has been isolated of the style x == f(c1,c2,c3) and not x == f(c1,c2,c3,x). $\endgroup$
    – rhermans
    May 24 at 14:15

1 Answer 1

7
$\begingroup$

It seems you have a Transcendental equation, so you will need to approximate, and that implies choices:

  • Wich kind of approximation
  • To which order
  • Around what value?

In this example PadeApproximant, order {1,2}, around zero.

Block[
    {
        eqn = (Exp[-x^2]==c1/Sqrt[c2-c3 x]),    (* Define equality *)
        lhs, rhs, pa
    },
    {lhs,rhs}=List@@ApplySides[Power[#,2]&,eqn];(* Manipulate as necesary *)
    pa=PadeApproximant[lhs, {x, 0, {1,2}}];     (* Algebraic aprox*)
    x/.FullSimplify@Solve[pa == rhs, x]         (* Solve *)
]

enter image description here

How good was the PadeApproximant? I approximated around zero, you may want to try something else.

enter image description here

If you are willing to tolerate a messier expression, a better approximation could be around (c2- 4*c1^2)/c3, ie Solve[rhs==1/4,x]

PadeApproximant[lhs, {x, (c2- 4*c1^2)/c3, {1,2}}]

enter image description here

$\endgroup$
6
  • $\begingroup$ This does not match the root for x<0 which is x -> -0.875079 when using {c1 -> 1, c2 -> 2, c3 -> 3} ? Your gives -1.78078 for these c values. $\endgroup$
    – Nasser
    May 24 at 10:33
  • $\begingroup$ When using approximation at -1, now your method gives good agreement. -0.874565 But it also gives second one -0.216816, which does not show in the plot as being a root? $\endgroup$
    – Nasser
    May 24 at 10:39
  • $\begingroup$ i.e. Plot[{Exp[-x^2], c1/Sqrt[c2 - c3* x]} /. {c1 -> 1, c2 -> 2, c3 -> 3}, {x, -2, 0}] shows one root at x->-0.874565 which your method gives correctly when using x=-1 for approximation. But second value it also gives, which not sure what it means. $\endgroup$
    – Nasser
    May 24 at 10:41
  • $\begingroup$ Your answer is good. I was just wondering what the second value mean, that is all. $\endgroup$
    – Nasser
    May 24 at 10:43
  • $\begingroup$ @Nasser see the second figure, where I plot RHS too for those arbitrary values. It means the LHS and RHS cross in two places. $\endgroup$
    – rhermans
    May 24 at 10:46

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.