Where is my error in trying to find Pythagorean triples with matching areas?
I notice that the equation is of the following form (I replaced $n$ by $x$):
$x^3 - m^2 x + \frac{D}{m} = 0$
Please see the following reference for the trigonometric solution. This is applicable to your case since the coefficient of $x$ is negative. This means your equation has three real roots.
Trigonometric solution for three real roots
In summary:
Let
$p = -m^2$
$q = \frac{D}{m}$
$a = \frac{-p}{3}$
$b = \frac{q}{2}$
$C(p, q) = 2 \sqrt{a} \cos\left(\frac{1}{3} \arccos \left(\frac{-b}{a} \sqrt{\frac{1}{a}}\right)\right)$
Then the three roots are given by
$t_0 = C(p, q)$
$t_1 = C(p, -q) - C(p, q)$
$t_2 = -C(p, -q)$
I checked that the method works for both of your examples.
Let me include the output of a program I wrote:
For (6, 2)
p:-4.0
q:3.0
Answer:
$t_0$: 1.3027756377319946
$t_1$: 1.0000000000000002
$t_2$: -2.302775637731995
For (2730, 10)
p:-100.0
q:273.0
Answer:
$t_0$: 8.156603957913985
$t_1$: 2.9999999999999982
$t_2$: -11.156603957913983
For (2730, 14)
p:-196.0
q:195.0
Answer:
$t_0$: 13.47318861248212
$t_1$: 1.0
$t_2$: -14.47318861248212