# Numerical solutions of a multivariable equation

I have been desperately trying to find a way to get this equation solved with Mathematica (I am using version 11.1 if that matters):

$$a\sqrt7 + b\sqrt{11} = (\sqrt7 + \sqrt{11})^{13},$$

assuming that $$a$$ and $$b$$ are positive integers.

This is a really easy equation to solve and it admits the solution $$a=2274430976$$ and $$b=1814368256$$.

So naturally I thought Mathematica would find the result:

Solve[{(Sqrt[7] + Sqrt[11])^(13) == a Sqrt[7] + b Sqrt[11] && a > 0 && b > 0}, {a, b}, Integers]


But instead, I get a warning message:

Solve::svars: Equations may not give solutions for all "solve" variables.


And then the "solution" is this weird output:

{{b -> ConditionalExpression[(2274430976 Sqrt[7] + 1814368256 Sqrt[11] - Sqrt[7] a)/Sqrt[11], (a | (2274430976 Sqrt[7] + 1814368256 Sqrt[11] - Sqrt[7] a)/Sqrt[11]) \[Element] Integers && 1 <= a <= 4548861952]}}


So I thought I had to extract the values somehow from the solution, and I tried:

sol=Solve[...]
a./sol


Which yielded:

{a}


No help there. Then I tried using Normal[%] and First[%] and various combinations thereof, but I got even weirder output.

How can I find the correct numerical solutions for $$a$$ and $$b$$? All the help I find online ends up in weird warnings. Maybe my Mathematica is too old, and has a different syntax? Can someone help?

EDIT: I'm using version 11.1

• Expand the RHS: (List @@ ((Sqrt[7] + Sqrt[11])^13 // Expand)) /. _Power :> 1 evaluates to {2274430976, 1814368256} Commented Dec 7, 2023 at 17:06
• Could extract coefficients of each square root, like so. In[241]:= Solve[ CoefficientList[(Sqrt[7] + Sqrt[11])^(13) - (a*Sqrt[7] + b*Sqrt[11]), {Sqrt[7], Sqrt[11]}] == 0] Out[241]= {{a -> 2274430976, b -> 1814368256}} Commented Dec 7, 2023 at 20:56

The expansion yields the result (as expressed by others)

expr = (Sqrt[7] + Sqrt[11])^13 // Expand
Sequence @@ Cases[expr, Times[a_, #] :> a] & /@ {Sqrt[7], Sqrt[11]}


• Thank you for this. This is the only solution that I can reproduce on Mathematica 11.1 so I will accept it. Commented Dec 8, 2023 at 17:15

Mathematica v12.2 solves without problems:

Solve[{(Sqrt[7] + Sqrt[11])^(13) == a Sqrt[7] + b Sqrt[11] , a > 0,b > 0}, {a, b}, Integers]
(*{{a -> 2274430976, b -> 1814368256}}*)

Solve[{(Sqrt[7] + Sqrt[11])^(13) == a Sqrt[7] + b Sqrt[11] }, {a,b},PositiveIntegers]
(*{{a -> 2274430976, b -> 1814368256}}*)

• So then it's because I'm using Mathematica 11.1? Is that the issue? I don't want to have to spend another 400 USD on a newer version every two years... Commented Dec 7, 2023 at 13:40
• In fact it also works in version 13.0 for Linux. Maybe the OP has defined something previously and now this is giving problems... Commented Dec 7, 2023 at 13:40

Use Reduce instead of Solve

Reduce[{(Sqrt[7] + Sqrt[11])^(13) == a Sqrt[7] + b Sqrt[11] && a > 0 &&    b > 0}, {a, b}, Integers]

(*a == 2274430976 && b == 1814368256*)


Also

FindInstance[(Sqrt[7] + Sqrt[11])^(13) == a Sqrt[7] + b Sqrt[11], {a,b}, Integers]


Gives the same output.

And also

NSolve[{(Sqrt[7] + Sqrt[11])^(13) == a Sqrt[7] + b Sqrt[11] && a > 0 && b > 0}, {a, b}, Integers]

• For Reduce, I get this/ $$(a | b) \[Element] Integers && b == 4096/11 (4872571 + 555281 Sqrt[77]) - Sqrt[7/11] a$$, and for FindInstance I get "FindInstance::nsmet: The methods available to FindInstance are insufficient to find the requested instances or prove they do not exist." Commented Dec 7, 2023 at 13:40
• @Klangen that is weird... I have tried mine and yours code on version 11.3 and it also works. Try restarting Mathematica. If it still doesn't work it might be a version specific problem Commented Dec 7, 2023 at 13:43
• Is it possible that in version 11.3 they switched the behaviour of Solve, from symbolic/conditional to numerical? Commented Dec 7, 2023 at 14:00
• I don't know... but you can also try NSolve this is purely numerical @Klangen Commented Dec 7, 2023 at 14:05
• NSolve yields the same warning and ConditionalExpression as Solve Commented Dec 7, 2023 at 14:40