On the j-function $j\big(\frac{1+\sqrt{-31}}{2}\big)$ and special cubics Given the j-function,
$$j(\tau) = {1 \over q} + 744 + 196884 q + 21493760 q^2 + \dots$$
It seems that for $\tau = \frac{1+\sqrt{-d}}{2}$ and $d=12n+7$, then it has the form,
$$j(\tau) = 12^3(1-x^2)^3\tag1$$
where $x$ is an algebraic number of degree equal to the class number $h(-d)$. For example, if $d=31$, then $x$ is a root of,
$$8x^3 - 24x^2 - 90x - 81 =0\tag2$$
It is easy to solve for the real root of  $(2)$ using Cardano's formula. However, as I saw in this link, it can also be expressed in the rather aesthetic form,
$$x = 1+\tfrac{\sqrt{19}}{2}\left(\left(\tfrac{13-\sqrt{93}}{13+\sqrt{93}}\right)^{1/2}\left(\tfrac{\sqrt{31}+\sqrt{27}}{\sqrt{31}-\sqrt{27}}\right)^{1/3}+\left(\tfrac{13+\sqrt{93}}{13-\sqrt{93}}\right)^{1/2}\left(\tfrac{\sqrt{31}-\sqrt{27}}{\sqrt{31}+\sqrt{27}}\right)^{1/3}\right)\tag3$$
For $d = 139$, we have,
$$x^3 - 141x^2 + 351x - 243 = 0\tag4$$
Question: How do we express the real root of $(4)$ in a similar form to $(3)$? If it is not possible, what are the special conditions on the coefficients of a cubic so that it is expressible as such? 

make an answer so you can see. From your own answer, it appears you want $x^2 + xy + 83 y^2$ and $x^2 + xy + 137 y^2$ rather than $x^2 + 331 y^2$ and $x^2 + 547 y^2.$ So, see
 
If you really wanted the latter forms, those are class number $9$ and will take longer. 
