Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

24. The natural exponential function can be expressed by ex =2 Deter mine e by c

ID: 2248506 • Letter: 2

Question

24. The natural exponential function can be expressed by ex =2 Deter mine e by calculating the sum of the series for: (a) n=5, (b) n= 15, (c) n=25 For each part create a vector n in which the first element is 0, the increment is 1, and the last term is 5, 15, or 25. Then use element-by-element calcula- tions to create a vector in which the elements are . Finally, use the MAT- LAB built-in function sum to add the terms of the series. Compare the values obtained in parts (a), (b), and (e) with the value of e2 calculated by MATLAB.

Explanation / Answer

Matlab Script:

x = 2;
%part a
n1 = 0:5;
e2_a = (x.^n1)./factorial(n1);%element by element calculation
e2_a_sum = sum(e2_a);
disp('exp(2) when n=5');
disp(e2_a_sum);
%part b
n2 = 0:15;
e2_b = (x.^n2)./factorial(n2);
e2_b_sum = sum(e2_b);
disp('exp(2) when n=15');
disp(e2_b_sum);
%part c
n3 = 0:25;
e2_c = (x.^n3)./factorial(n3);
e2_c_sum = sum(e2_c);
disp('exp(2) when n=25');
disp(e2_c_sum);
disp('actual value of e^2');
disp(exp(2));

Command window output:

exp(2) when n=5
7.2667

exp(2) when n=15
7.3891

exp(2) when n=25
7.3891

actual value of e^2
7.3891

>>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote