Given an optimization as follows: \begin{align} \text{minimize}\quad (x_{1}-1)^2+(x_{2}-2)^2 \\ \text{subject to}\quad (x_{1}-1)^2 = 5x_{2} \quad \\ \end{align}
Guys I'm new here, I'm with this problem that I can not solve.
My resolution
Lagrangian
$L(x_{1},x_{2}, \lambda ) = (x_{1}-1)^2+(x_{2}-2)^2+\lambda(x_{1}^2-2x_{1}-5x_{2}+1)$
$\frac{\partial L }{\partial x_{1}} = 2\left(x_1-1\right) + 2\lambda x_{1} - 2 \lambda = 0$
$\frac{\partial L }{\partial x_{2}} = 2\left(x_2-2\right)-5\lambda = 0$
$\frac{\partial L }{\partial \lambda} = x_{1}^2-2x_{1}-5x_{2}+1 = 0$
$\lambda = \frac{2\left(x_2-2\right)}{5}$
How do I find the optimal solution? I don't know what to do
So our two equations you found combined imply that
$$ \lambda = \frac{2(x_2 -2)}{5} $$
[I didn't check this and will just assume you did the algebra correctly].
So now what to do with this information? We need to go ahead and grab one of your unused original equations. I will select
$$ \frac{\partial L}{\partial x_1} = 0 \rightarrow (2 x_2 - 2) - 5 \lambda = 0$$
And we need to recall the third equation you forgot
$$ \frac{\partial L}{\partial \lambda } = 0 $$
This of course just gives
$$ (x_1 - 1)^2 - 5x_2 = 0 $$
Which you might recognize as the original constraint. (The derivative w.r.t the lagrange parameter always gives the constraint)
So now we have our three equations
$$ \lambda = \frac{2(x_2 - 2)}{5} $$ $$ 2(x_1 - 1) + 2\lambda (x_1 - 1) = 0 $$ $$ (x_1 - 1)^2 - 5x_2 = 0 $$
We eliminate the $\lambda$ term.
$$ 2(x_1 - 1) - 2(x_1 - 1) \frac{2(x_2 - 2)}{5} = 0$$ $$ (x_1 -1)^2 - 5x_2 = 0$$
And now we can solve this system of two equations in two unknowns but observe carefully a little earlier:
$$ 2(x_1 - 1) + 2\lambda (x_1 - 1) = 0 $$
Implies
$$ 2(x_1 - 1)(1 + \lambda) = 0 $$
So this simplifies your work considerably see @subrosar's answer for how that works/how to observe that trick even earlier in the problem.