How to align equations as in the image below?

Update: I try using array but it takes so much work to align everything in order. For example, I need to know how many columns I need to perform the alignment.
Using align and friends from amsmath:

\documentclass{article}
\usepackage{amsmath,mathpazo}
\newcommand{\deriv}[2][x]{\frac{\mathrm{d}#2}{\mathrm{d}#1}}
\begin{document}
\begin{align*}
q u^{q-1} \deriv{u} &= p x^{p-1} \\
\deriv{u} &= \frac{p x^{-1}}{q u^{-1}} \\
\deriv{u} &= n x^{n-1}
\end{align*}
\end{document}
This is pretty well answered but I'll try and make it simpler:
like others have said, you want to add \usepackage{amsmath} to your preamble, and then put the equations in an align environment.
\documentclass{article}
\usepackage{amsmath}
\begin{document}\noindent
Equations with numbers: align
\begin{align}
2 + 2 &= 4\
\frac{\sqrt{y}}{x^2} &= a
\end{align}
Equations without numbers: align* (the * removes the numbers)
\begin{align}
2 + 2 &= 4\
\frac{\sqrt{y}}{x^2} &= a
\end{align}
The & symbol defines alignment points, it can go near any
symbol or character and allows different placements:
\begin{align}
1 & 2 & 3 & 4 & 5 & 6\
&&& 4 \
&&&&& 6
\end{align}
This can be useful if you want
\begin{align}
\text{Labels over here} && 45 + 10 &= 55\
\text{and equations over there} && foo &= bar\ baz\
\text{while still aligned by the ``='' sign.}
\end{align}
\end{document}
Not sure if I actually made that easier, but I tried.
If you get the Paragraph ended before \align* was complete. error, it's because you can't have empty lines (which are interpreted as paragraph breaks) inside of an align environment.
alignenvironment from theamsmathpackage. there are many examples of its use in this forum. – barbara beeton Nov 10 '14 at 18:33align-like environments. – Werner Nov 10 '14 at 19:11array-environment! – Sveinung Nov 11 '14 at 09:09