I want to solve the following equation for $x$:

eq = (g^2 π^2)/(128 x^2) + (4 x^2 y)/π - 1/16 k^2 Log[(2 x)/(π q)] == c
Solve[eq, x]

in which all the parameters are positive. Running this code for a long time does not lead to answer. How can I be sure that Mathematica can or can't solve this equation?

  • 2
    $\begingroup$ In general, practically speaking, I don't think you can be sure, unless one has special knowledge about the equation and techniques to solve it. In cases such as this in which there are parameters, you can replace them by typical exact values, like this: Solve[eq /. {g -> 1, k -> 1, q -> 1, c -> 1}, x] (result Solve::nsmet, can't be solved). It's usually much faster, since the complexity of analyzing parameters usually grows extremely fast with the number of parameters. If the special case cannot be solved, then probably the general case cannot be solved either. $\endgroup$
    – Michael E2
    Jun 8, 2021 at 16:02
  • 1
    $\begingroup$ Here's a small suggestion that often helps, but alas not here: merge and eliminate unneeded variables: let $g^2 \pi^2/128 = a$, let $4 y/\pi = b$, and so on. Then let $x^2 = z$ (a new variable). I think, though, that for your particular equation there is no closed-form solution. $\endgroup$ Jun 8, 2021 at 17:13
  • 2
    $\begingroup$ Solve is likely to spend serious time trying transformations to obtain a solution using ProductLog. I doubt one exists though. $\endgroup$ Jun 8, 2021 at 18:16
  • $\begingroup$ @MichaelE2 Thanks a lot. Yes, by this way one can check if the equation can be solved or not by spending little time. $\endgroup$
    – Kheeyal
    Jun 8, 2021 at 20:22
  • 1
    $\begingroup$ As a rough rule of thumb, the presence of transcendental functions generally reduces the odds of getting an a closed form solution for the equation, barring certain special cases. $\endgroup$ Jun 11, 2021 at 13:03

1 Answer 1


The equation can be set into a form

$$ \dfrac{A}{x^2} + B x^2 y = P \log x +Q $$

so it can be solved algebraically, no need to use Mathematica:

$$ y(x) = \dfrac{ P \log x + Q - \dfrac{A}{x^2} }{Bx^2}$$

For some arbitrarily chosen constants the above is plotted... and level contour lines can be drawn if so required.

It may help to understand the physical significance of the constants in the phenomenon.


You can also get $x=f(y)$ at uniform $y$ increments with numerical integration of ode

$$\dfrac{dx}{dy}=\frac{B x^5}{Px^2-2 Bx^4 y -2A} ;$$

enter image description here

  • $\begingroup$ Thanks for the answer. In fact I need the analytic solution of the equation. Using numerical methods I could move the issue forward. I wonder if the analytic solution can be found. $\endgroup$
    – Kheeyal
    Jun 8, 2021 at 20:18
  • $\begingroup$ Can be found as $y=f(x) $ added in answer. $\endgroup$
    – Narasimham
    Jun 8, 2021 at 21:03
  • $\begingroup$ I want to find x not y. $\endgroup$
    – Kheeyal
    Jun 10, 2021 at 11:15
  • $\begingroup$ No analytical solution for transcendental functions. ..A table of $ x\; vs \;y $ for uniform x increments is straightaway possible numerically . Using a differential equation $ y \;vs\; x$ can be also tabulated as a workaround. Do you want it? $\endgroup$
    – Narasimham
    Jun 10, 2021 at 17:16

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.