If $a^2+a b+b^2=40$ and $a^2-\sqrt{a b}+b=5$, then find $a^2+\sqrt{a b}+b$ I was given this problem to solve with elementary methods (High School level).

Knowing that
$$\begin{align}
a^2+a b+b^2 &=40 \\
a^2-\sqrt{a b}+b &=\phantom{0}5
\end{align}$$
find
$$a^2+\sqrt{a b}+b$$

I tried to look for $\sqrt{a b}$, since the requested quantity is
$$a^2+\sqrt{a b}+b=(a^2-\sqrt{a b}+b)+2\sqrt{ab}=5 + 2\sqrt{ab}$$
So I set
$$x=a^2;\;y=\sqrt{ab};\;b=z$$
and the system became
$$x+y^2+z^2=40;\;x-y-z=5$$
subtracting the two equations I got
$$z^2-z+y^2+y-35=0$$
which has one real solution when the discriminant is zero.
That is
$1-4(y^2+y-35)=0$
and then
$y=\frac{1}{2} \left(-1\pm\sqrt{142}\right)$
and finally
$$a^2+\sqrt{a b}+b=4\pm\sqrt{142}$$
I know that there are other solutions because I've found them with Wolfram Mathematica, but I couldn't find them with elementary methods.
Any help will be appreciated.
 A: We could try to "brute force" it at the high school level. Start with the second equation
$$a^2 - \sqrt{ab} + b = 5$$
$$a^2  + b -5 = \sqrt{ab}$$
$$a^4 + b^2 + 25 + 2a^2 b -10a^2 -10b = ab$$
$$b^2 + ( 2a^2 -10 -a) b + (a^4 -10a^2 +25) =0$$
$$b = \frac{-(2a^2 -10 -a) \pm \sqrt{( 2a^2 -10 -a)^2 - 4(a^4 -10a^2 +25))}}{2}$$
$$b = \frac{-(2a^2 -10 -a) \pm \sqrt{a (-4 a^2 + a + 20)}}{2}$$
Now let's just call $b=x \pm \sqrt{y}.$
$$b^2 = x^2 \pm 2x\sqrt{y} + y$$
$$ab = ax \pm a\sqrt{y}$$
Plug this into the second equation:
$$a^2 +ab + b^2 =40$$
$$a^2 + ax \pm a\sqrt{y} + x^2 \pm 2x\sqrt{y} + y =40 $$
$$(\pm a \pm 2x)\sqrt{y}=40 -a^2 - ax - x^2 -y$$
$$(a^2 \pm 2xa + 4x^2)y=(40 -a^2 - ax - x^2 -y)^2$$
Now plug in for $x, y$ and solve for $a$. What you end up with is:
$$-225 + 950 a - 290 a^2 - (255 a^3)/2 - (53 a^4)/4 - (45 a^5)/2 + 
 14 a^6 + 2 a^7 - a^8 =0$$ This is not tractable, and it is likely the problem has a typo.
If you type in Mathematica
Solve[{a^2 + a*b + b^2 == 40, \[Sqrt](a*b) + 5 == a^2 + b}, {a, b}]

It will spit out 3 gross looking expressions possible answers. If you then evaluate these for $a^2 + b + \sqrt{ab}$
a^2 + b + Sqrt[a b] /. %OUTPUT NUMBER

Then the resulting expression doesn't simplify nicely. (Which is not a guarantee; Mathematica's simplify function is far from perfect).
A: One way to do this is to graph out these equations of lines.
Find the values of $a,b$ and plug into the desired output equation:

*

*Equation of a line:
see link here.


*Look at the possible values and


*plug answers into the final equation:

