The real numbers $x,y$ and $z$ are such that $x-7y+8z=4$ and $8x+4y-z=7$. What is the maximum value $x^2-y^2+z^2?$

The real numbers $$x,y$$ and $$z$$ are such that $$x-7y+8z=4$$ and $$8x+4y-z=7$$. What is the maximum value of $$x^2-y^2+z^2?$$

From those equations I got:

$$12z-5x=13y$$

$$12x+5z=13$$

$$12y+5=13z$$

$$12-5y=13x$$

I know that $$5,12,13$$ is a pythag triplet but I don’t know what to do next. I think lagrange multipliers could be used but there should be a solution that doesn’t require calculus

Hints, suggestions and solutions would be appreciated.

Taken from the 2014 KIMC https://chiuchang.org/imc/wp-content/uploads/sites/2/2018/01/2014-IWYMIC-Individual.x17381.pdf

• In spite of the appearance of the Pythagorean triple I don't think this has much at all to do with number theory. Anyway, this looks a bit easy to be a contest problem. The two linear equations describe the line of intersection of two planes in $\Bbb{R}^3$. You can parametrize that line, and plug in $(x,y,z)$, and you are left with the task of finding the maximum of a quadratic polynomial in a single variable. It turns out that the polynomial is a constant, but while surprising that doesn't in my opinion make this contest-worthy (may be junior high school level?) Sep 15 '19 at 9:58

Solving the system $$x-7y+8z=4$$ $$8x+4y-z=-7$$ we get $$y=\frac{12}{5}-\frac{13}{5}x$$ $$z=\frac{13}{5}-\frac{12}{5}x$$ and we get $$x^2-y^2+z^2=1$$ Very NICE!

Below please find an image of the surface $$x^2-y^2+z^2=1$$ together with the (thick red) line of intersection of the two given planes. • Thank you for making an image of the problem! Sep 15 '19 at 10:27
• And greetings to Finland with all your brave poeple! Sep 15 '19 at 10:33
• Im sorry but I don’t understand how you got from $$y=\frac{12}{5}-\frac{13}{5}x$$ $$z=\frac{13}{5}-\frac{12}{5}x$$ To $$x^2-y^2+z^2=1$$ Sep 15 '19 at 10:34
• Expand $$x^2-\left(\frac{15}{5}-\frac{13}{5}x\right)^2+\left(\frac{13}{5}-\frac{12}{5}x\right)^2=1$$ Sep 15 '19 at 10:37

Solving for $$x,y$$ in terms of $$z$$

$$12x=13-5z$$

$$12y=13z-12$$

$$12^2(x^2-y^2+z^2)=(13-5z)^2-(13z-12)^2+144z^2$$

$$=-50z^2-(130+312)z+25$$

$$=-50\left(z+\dfrac{442}{100}\right)^2+25+50\left(\dfrac{442}{100}\right)^2$$

$$\le25+50\left(\dfrac{442}{100}\right)^2$$