Actually this exercise just show you how to use Lagrange multipliers, not ask you to solve some problem using Lagrange multipliers, which means you only need to know simple calculus to solve it.
we already know
∂
u
∂
x
i
/
p
i
=
∂
u
∂
x
j
/
p
j
{\displaystyle {\tfrac {\partial u}{\partial x_{i}}}/p_{i}={\tfrac {\partial u}{\partial x_{j}}}/p_{j}}
holds for any
i
{\displaystyle i}
,
j
{\displaystyle j}
. Let's take
i
=
1
{\displaystyle i=1}
,
j
=
2
{\displaystyle j=2}
for example:
Since
u
=
x
1
a
1
⋅
x
2
a
2
⋅
⋯
x
n
a
n
{\displaystyle u=x_{1}^{a_{1}}\cdot x_{2}^{a_{2}}\cdot \cdots x_{n}^{a_{n}}}
, wet get
∂
u
∂
x
1
/
p
1
=
∂
u
∂
x
2
/
p
2
⇒
a
1
x
1
a
1
−
1
⋅
x
2
a
2
⋅
x
3
a
3
⋅
⋯
x
n
a
n
p
1
=
x
1
a
1
⋅
a
2
x
2
a
2
−
1
⋅
x
3
a
3
⋅
⋯
x
n
a
n
p
2
⇒
x
1
x
2
=
a
1
/
p
1
a
2
/
p
2
{\displaystyle {\begin{aligned}{\frac {\partial u}{\partial x_{1}}}/p_{1}&={\frac {\partial u}{\partial x_{2}}}/p_{2}\\\Rightarrow {\frac {a_{1}x_{1}^{a_{1}-1}\cdot x_{2}^{a_{2}}\cdot x_{3}^{a_{3}}\cdot \cdots x_{n}^{a_{n}}}{p_{1}}}&={\frac {x_{1}^{a_{1}}\cdot a_{2}x_{2}^{a_{2}-1}\cdot x_{3}^{a_{3}}\cdot \cdots x_{n}^{a_{n}}}{p_{2}}}\\\Rightarrow {\frac {x_{1}}{x_{2}}}&={\frac {a_{1}/p_{1}}{a_{2}/p_{2}}}\end{aligned}}}
Similarly, we can deduce:
x
i
x
j
=
a
i
/
p
i
a
j
/
p
j
holds for any
i
,
j
∈
{
1
,
2
,
3
⋯
n
}
{\displaystyle {\begin{aligned}{\frac {x_{i}}{x_{j}}}={\frac {a_{i}/p_{i}}{a_{j}/p_{j}}}\;{\text{holds for any}}\;i,j\in \{1,2,3\cdots n\}\end{aligned}}}
then, let
x
i
=
a
i
p
i
⋅
k
for
i
∈
{
1
,
2
,
3
⋯
n
}
{\displaystyle {\begin{aligned}x_{i}={\frac {a_{i}}{p_{i}}}\cdot k\;\;\;\;{\text{for}}\;i\in \{1,2,3\cdots n\}\end{aligned}}}
substitute these into
p
1
x
1
+
p
2
x
2
+
⋯
+
p
n
x
n
=
l
{\displaystyle p_{1}x_{1}+p_{2}x_{2}+\cdots +p_{n}x_{n}=l}
, we get:
∑
i
=
1
n
p
i
⋅
a
i
p
i
k
=
l
⇒
k
=
l
∑
i
=
1
n
a
i
{\displaystyle {\begin{aligned}\sum _{i=1}^{n}p_{i}\cdot {\frac {a_{i}}{p_{i}}}k&=l\\\Rightarrow k&={\frac {l}{\sum _{i=1}^{n}a_{i}}}\end{aligned}}}
Finally,
x
i
=
a
i
p
i
⋅
k
=
a
i
l
p
i
∑
i
=
1
n
a
i
for
i
∈
{
1
,
2
,
3
⋯
n
}
{\displaystyle {\begin{aligned}x_{i}&={\frac {a_{i}}{p_{i}}}\cdot k\\&={\frac {a_{i}l}{p_{i}\sum _{i=1}^{n}a_{i}}}\;\;\;\;\;{\text{for}}\;i\in \{1,2,3\cdots n\}\end{aligned}}}