(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

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]

2. Relevant equations

3. 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.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Differentiation in MATLAB

**Physics Forums | Science Articles, Homework Help, Discussion**