Among all pairs of numbers (x,y) such that 3x+y=15, find the minimum of x^2 + y^2.
3x + y = 15
y = 15 - 3x
So
minimize x^2 + (15 -3x)^2
minimize x^2 + 9x^2 - 90x + 225
minimize 10x^2 - 90x + 225 take the derivative and set to 0
20x - 90 = 0
x = 90 / 20 = 9/2
x^2 = 81/4
And y = 15 - 3(9/2) = 15 - 27/2 = 3/2
y^2 = 9/4
So
min x^2 + y^2 = (81/4) + (9/4) = 90 / 4 = 45 / 2 = 22.5