durrett
(Warren Durrett)
June 27, 2014, 9:19pm
1
I’m trying to get used to computing derivatives within Mathematica but am unsure as to how to compute a derivative with a summation within the expression. Is there anyway someone can show me how to compute the derivative of the following function using commands in Mathematica?
f (x) = Summation [ ke^-(ax^3)] with k min = 1, k max = 7] with a being a constant
Do I need to define a as a constant prior?
Any ideas?
The answer should come out to -3akx^2
nma
(Nasser M. Abbasi)
June 27, 2014, 9:37pm
2
The answer should come out to -3akx^2
What happend to exp() function in the answer? This is what Mathematica gives
Clear[x, a, k]
f = Sum[ k Exp[-a x^3], {k, 1, 7} ];
D[f, x]
(* (-84*a*x^2)/E^(a*x^3) *)
There is no need to define a function f[x] in here. it is just an expression. But this also works
Clear[x, a, k]
f[x_] := Sum[ k Exp[-a x^3], {k, 1, 7} ];
D[f[x], x]
durrett
(Warren Durrett)
June 27, 2014, 10:05pm
3
Wait you’re right about the exponential!
However, the answer should come off as -summation (k = 1 to k = 7) 3kax^2e^-(a^3)
but what you gave isn’t correct - do I need to state that a is a constant prior?
Will the following be sufficient? It has the derivative term, multiplied by the result of the summation where the limits have been parametrized.
In[138]:=
Clear["Global`"]; ( Clear. *)
s[x_] := Sum[ k Exp[-a x^3], {k, m, n}]; (* Define the expression. *)
D[ s[x], x] (* Find Derivative. *)
Out[140]= 3/2 a E^(-a x^3) (-1 + m - n) (m + n) x^2
When m and n are assigned values, we will get back a single expression.
In[141]:= % /. {m → 1, n → 7}
Out[141]= -84 a E^(-a x^3) x^2