This can be solved by geometry.

The constraint is the surface of a sphere of radius 1.

The given plane has a normal unit vector of (i+3j+5k)/sqrt(1²+3²+5²)

=(i+3j+5k)/sqrt(35).

So the maximum and minimum value of x+3y+5z is at

(x,y,z)=(1,9,25)/sqrt(35).

Which when substituted into the equation of the plane gives P(x,y,z)=1.

Using Lagrange multipliers:

Objective function:

P(x,y,z)=x+3y+5z+L(x²+y²+z²-1)

where L=lagrange multiplier (lambda)

Partially differentiate with respect to x, y and z gives the first order conditions:

∂P/∂x = 1+2xL = 0

∂P/∂y = 3+2yL = 0

∂P/∂z = 5+2zL = 0

Solve for x,y and z in terms of L and substitute in the constraint equation of x²+y²+z²=1

(-1/2L)²+(3/2L)²+(5/2L)² = 1

Solve for L to get

L=±sqrt(35)/2

Substitute to get maximum

x= 1/2L = 1/sqrt(35)

y= 3/2L = 3/sqrt(35)

z= 5/2L = 5/sqrt(35)

or

P(x,y,z)=(1+9+25)/sqrt(35)=1