# Solve not returning anything

I have the following function:

test = D[(a - A)^2 + (b - B)^2 + (c - C)^2 +
( a + b - (S + c) - D)^2 - λ1*a - λ2* b - λ3*c  - λ4*(a + b - (S + c)),
{{a, b, c}}]


Then I solve for a,b,c, and get:

solutions = Solve[Thread[test == 0], {a, b, c}]


So now, I plug the results of a,b,c back into test to remove a,b,c from my original equation and take the derivatives with respect to Lambda1, Lambda2,Lambda3,Lambda4. So I get the following:

results =
ExpandAll[
D[(a - A)^2 + (b - B)^2 + (c - C)^2 +
( a + b - (S + c) - D)^2 - λ1*a - λ2* b - λ3*c - λ4*( a + b - (S + c)) /.
solutions[[1]], {{λ1, λ2, λ3,  λ4}}]]


However, when I try to solve for Lambda1, Lambda2,Lambda3,Lambda4, I get nothing back:

lambdasolutions = Solve[Thread[ results == 0], {λ1, λ2, λ3, λ4}]


Am I doing something wrong?

• Do NOT use capitals for variable names. – Histograms Jun 12 '15 at 4:23
• @Histograms where did I use capitals? the A,B,C,D are constants. – kolonel Jun 12 '15 at 4:25
• Look at the following: C; D. In particular: you seem to know that D[] is a built in function, but then you used it as a constant as well!? – MarcoB Jun 12 '15 at 4:34
• @Histograms ok I removed the capitals thanks. However, I am still getting nothing. Did you get a result when you ran it? – kolonel Jun 12 '15 at 4:40
• @kolonel I got nothing too. Perhaps there are no solutions. – Histograms Jun 12 '15 at 4:45

Use Reduce[ ] instead of Solve[ ]

exp = (a - A)^2 + (b - B)^2 + (c - CC)^2 + (a + b - (S + c) -
DD)^2 - λ1*a - λ2*b - λ3* c - λ4*(a + b - (S + c));
test = D[exp, {{a, b, c}}];
solutions = Solve[Thread[test == 0], {a, b, c}];
results = ExpandAll[  D[exp /. solutions[[1]], {{λ1, λ2, λ3, λ4}}]];
lambdasolutions = Reduce[Thread[ results == 0], {λ1, λ2, λ3, λ4}]

(* S == 0 && λ2 == 2 A - 2 B + λ1 && λ3 == -2 A - 2 CC - λ1 && λ4 == -2 A - 2 DD - λ1 *)

• should I interpret this as this solution could only hold if S == 0? Also thanks. – kolonel Jun 12 '15 at 5:27
• @kolonel there is no solution if S != 0 – Dr. belisarius Jun 12 '15 at 5:38
• alright thank you sir. – kolonel Jun 12 '15 at 6:01