maximum of $f(x,y) = ax + by$ subject to $x^p + y^p = 1$ where both $x$ and $y$ are positive. I'm using the method of Lagrange multipliers.
The Lagrangian for this problem is given by:
$L(x,y,λ) = ax + by - λ(x^p + y^p - 1)$
Setting the partial derivatives of $L$ with respect to $x, y,$ and $λ$ equal to zero, we get:
$∂L/∂x = a - λpx^{p-1} = 0$
$∂L/∂y = b - λpy^{p-1} = 0$
$∂L/∂λ = x^p + y^p - 1 = 0$
I came to $ay^{p-1}=bx^{p-1}$ using the inicial two equations but I don't know how to use $x^p + y^p - 1 = 0$ to find the values.
 A: All your calculus is correct you're just not using every equation consistently.
(1) $∂L/∂x = a - λpx^{p-1} = 0$
(2) $∂L/∂y = b - λpy^{p-1} = 0$
(3) $∂L/∂λ = x^p + y^p - 1 = 0$
(For $p\neq1$)
(1) $\Rightarrow$ $x=\left(\dfrac{a}{\lambda p}\right)^{1/(p-1)}$
(2) $\Rightarrow$ $y=\left(\dfrac{b}{\lambda p}\right)^{1/(p-1)}$
(1,2,3) $\Rightarrow$ $\left(\dfrac{a}{\lambda p}\right)^{p/(p-1)}+ \left(\dfrac{b}{\lambda p}\right)^{p/(p-1)}=1$
$\Rightarrow$ $\lambda=\left[\left(\dfrac{a}{ p}\right)^{p/(p-1)}+ \left(\dfrac{b}{ p}\right)^{p/(p-1)}\right]^{(p-1)/p}$
$x$ and $y$ follow. I hope that answers your question and doesn't spoil the fun of racking your brains too much.
A: If $a$ and $b$ are negative the maximal value is equal $0,$ as $x,y\ge 0.$ If $a>0$ and $b<0$ the maximal value is equal $a.$ For $a,b>0$ we can use the Hölder inequality $$ax+by\le (a^q+b^q)^{1/q}(x^p+y^p)^{1/p}=(a^q+b^q)^{1/q}$$ where $q=p/(p-1).$ The equality holds if $x=\lambda a^{1/(p-1)}$ and $y=\lambda b^{1/(p-1)},$ where $\lambda$ is determined by the requirement $x^p+y^p=1.$ Summarizing the maximal value is equal $(a^q+b^q)^{1/q}.$
