[Tex/LaTex] How to simply center equations using eqnarray*

amsmathequations

So I have this code here:

\begin{eqnarray*}
    x + (y - 2)^4 = w^2 \\
   (x  - 9)^2 + y_2^2 = w^2 \\
    x + (y - 2)^4 = w^2 = (x  - 9)^2 + y_2^2 \\
\end{eqnarray*}

As you can see, I get the following result:

enter image description here

My problem is that I want to 'center' all those equations, so that they 'look nice'. What that means is that I dont necessarily want the equal signs to be alligned. I want the entire thing to be centered, evenly, so that it looks pleasing to the eye. Basically, if the top two equations were moved to the left somehow, then that would be 'centered'.

How can I go about doing this?

Best Answer

For any kind of display math you should load the amsmath package.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{gather*}
    x + (y - 2)^4 = w^2 \\
   (x  - 9)^2 + y_2^2 = w^2 \\
    x + (y - 2)^4 = w^2 = (x  - 9)^2 + y_2^2 
\end{gather*}

\end{document}
Related Question