- #1
sara_87
- 763
- 0
Homework Statement
How do i differentiate a sum in MATLAB?
So for an example, if I have:
[tex]y = x^2 + \sum^{n}_{j=1}3x_{j}^4[/tex]
I want to differentiate it with respect to x.
It should return: [tex]2x + \sum^{n}_{j=1}12x_{j}^3[/tex]
Homework Equations
The Attempt at a Solution
If I want to differentiate y = x^3+2x, this is what i would do:
>> syms x
>> y = x^3+2*x
>> diff(y,x,1)
this gives:
ans =
3*x^2+2
which is correct but how would i do differentiation if i have a sum?
thank you.