Here, given problem comes under the category of Constrained Non-linear Optimization.
Since, objective function is convex function, So, it is Convex Programming problem.
Here, objective function $x^2 + y ^2$ is called level curve or circular contour curve or constant cost contour.
Here, we get the feasible region as :
So, point $(x,y)$ for which $x^2 + y^2$ is minimum, lies in the feasible region(shaded region) which we have to find.
This circular contour $x^2 + y^2$ will grow and since, its nearest boundry of feasible region is a line segment whose end points are $(4,6)$ and $(6,4)$ and when this level curve $x^2 + y^2$ touches the line segment, we get the minimum value.
So, actually, we have to find the point of tangency of $x^2 + y^2$ and line $x+y = 10$
Here, Line passes points ‘O’ and ‘P’ is perpendular to line $x+y = 10$
So, if slope for line passes through O and P is $m_1 $ then $m_1 = \frac{k}{h}$
and slope of line $x+y =10$ is $m_2 = -1$
Since, both lines are perpendicular to each other.
So, $m_1 \times m_2 = -1$
$ \frac{k}{h} \times (-1) = -1$
$\Rightarrow h=k$
point $(h,k)$ satisfies the line $x+y =10$
So, $h+k =10$
$\Rightarrow 2h = 10$
$\Rightarrow h=5$ and so, $k=5$
Hence, for point $(5,5),$ $x^2 + y^2$ gets the minimum value which is $5^2 + 5^2 = 50.$
We can also use the idea of Lagrange Multiplier here.
Here, Lagrangian function is :
$L(x,y,\lambda) = x^2 + y^2 – \lambda(x+y-10)$
Now, $\frac{\partial L}{\partial x}$ at $x=x^*$ is $2x^* – \lambda$
$\frac{\partial L}{\partial y}$ at $y=y^*$ is $2y^* – \lambda$
and $\frac{\partial L}{\partial \lambda}= -x^* -y^* +10$
For optimality, $\frac{\partial L}{\partial x} = 0, $ $\frac{\partial L}{\partial y}=0$ and $\frac{\partial L}{\partial \lambda}= 0$
So, we have $x^* = y^* = \frac{\lambda}{2}$
and $x^* + y^* = 10$ which implies $\frac{\lambda}{2} + \frac{\lambda}{2} = 10$ $\Rightarrow \lambda = 10$
Hence, optimal point is $(x^*,y^*) = (5,5)$
Therefore, minimum value of $x^2 + y ^2$ is $50.$
For visualization :
https://www.desmos.com/calculator/vhplzfc3lb
https://www.desmos.com/calculator/jsx6dibkno