MHB Lagrange multipliers with a summation function and constraint

skate_nerd
Messages
174
Reaction score
0
Problem stated: Let \(a_1, a_2, ... , a_n\) be \(n\) positive numbers. Find the maximum of
$$\sum_{i=1}^{n}a_ix_i$$ subject to the constraint $$\sum_{i=1}^{n}x_i^2=1$$.
I honestly have not much of an idea of how to go about solving this. If I use lagrange multipliers which I think I am supposed to since this problem is from that section of the book, how would I even begin to take partial derivatives of these summations, let alone solve a system of equations with them? Any hint on how to begin this would be appreciated. Thanks
 
Physics news on Phys.org
Re: lagrange multipliers with a summation function and constraint

skatenerd said:
Problem stated: Let \(a_1, a_2, ... , a_n\) be \(n\) positive numbers. Find the maximum of
$$\sum_{i=1}^{n}a_ix_i$$ subject to the constraint $$\sum_{i=1}^{n}x_i^2=1$$.
I honestly have not much of an idea of how to go about solving this. If I use lagrange multipliers which I think I am supposed to since this problem is from that section of the book, how would I even begin to take partial derivatives of these summations, let alone solve a system of equations with them? Any hint on how to begin this would be appreciated. Thanks

Hi skatenerd! :)

Suppose you had to maximize $ax+by$ subject to the constraint $x^2+y^2=1$.
Would you know how to do that?

If so, how about $ax+by+cz$?

The time to generalize is after that.
 
I noticed several guests viewing this topic, and thought I might go ahead and solve it, since time has gone by and it is interesting. :D

We have the objective function:

$$f\left(x_1,x_2,x_3,\cdots,x_n \right)=\sum_{k=1}^n\left(a_kx_k \right)$$

Subject to the constraint:

$$g\left(x_1,x_2,x_3,\cdots,x_n \right)=\sum_{k=1}^n\left(x_k^2 \right)-1=0$$

Using Lagrange multipliers, we obtain the system:

$$a_1=2\lambda x_1$$

$$a_2=2\lambda x_2$$

$$a_3=2\lambda x_3$$

$$\vdots$$

$$a_n=2\lambda x_n$$

This implies:

$$x_k=\frac{a_k}{a_1}x_1$$ where $$k\in\{2,3,4,\cdots,n\}$$

And so the constraint yields (taking the positive root since we are asked to maximize the objective function):

$$\sum_{k=1}^n\left(x_k^2 \right)=1$$

$$\sum_{k=1}^n\left(\left(\frac{a_k}{a_1}x_1 \right)^2 \right)=1$$

$$\left(\frac{x_1}{a_1} \right)^2\sum_{k=1}^n\left(a_k^2 \right)=1$$

$$x_1^2=\frac{a_1^2}{\sum\limits_{k=1}^n\left(a_k^2 \right)}$$

Taking the positive root, we then have:

$$x_1=\frac{a_1}{\sqrt{\sum\limits_{k=1}^n\left(a_k^2 \right)}}$$

Hence:

$$x_k=\frac{a_k}{\sqrt{ \sum\limits_{k=1}^n\left(a_k^2 \right)}}$$

And so we find:

$$f_{\max}=\sum_{k=1}^n\left(a_k\frac{a_k}{\sqrt{ \sum\limits_{k=1}^n\left(a_k^2 \right)}} \right)=\frac{\sum\limits_{k=1}^n\left(a_k^2 \right)}{\sqrt{ \sum\limits_{k=1}^n\left(a_k^2 \right)}}=\sqrt{ \sum\limits_{k=1}^n\left(a_k^2 \right)}$$
 
Wow, I think I completely forgot that I asked this question! This was in regard to my 3rd semester of calculus last year...Thanks for the responses and the solution MarkFL! Very cool indeed.
 

Similar threads

Back
Top