I'm trying to check some equations I did on paper, but I have troubles getting Mathematica to solve them.
The equation (with Latex):
My input: Sum[2 Subscript[x, i] (b Subscript[x, i] - Subscript[y, i]), {i, 1, n}] == 0
If I want to solve for b with Solve[%, b]
it says:
Solve::nsmet: This system cannot be solved with the methods available to Solve.
Are the indices the problem? I tried it with x[i]
and y[i]
, but that didn't work either.
What am I missing?
n
that's the problem. Mathematica doesn't do sums with variable upper limits very well. You have to put in values forn
in order forSolve
to find a solution (which it does, of course, easily). $\endgroup$"\!(*UnderoverscriptBox[([Sum]),(i=1),(n)](2\x[i]\((b\x[i]-y[i]))))==0
." I'm not familar with that notation. What are the `\` for? $\endgroup$n
's, you can verify that your general solution matches each specific case as evidence that your general solution is correct, but Mathematica doesn't know how to solve that equation, because it's hard to write down a general expression for the sum, and even if we could, it's likely to be of a nature that's hard to solve algebraically anyway. $\endgroup$