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

Taylor series expansions. Consider the Taylor series expansion of f(x) = ln x: l

ID: 3572869 • Letter: T

Question

Taylor series expansions. Consider the Taylor series expansion of f(x) = ln x: ln (x) = 2 [x - 1/x + 1 + (x - 1)^3/3(x + 1)^3 + (x - 1)^5/5(x + 1)^5 + (x - 1)^7/7(x + 1)^7 +...+ (x - 1)^2k + 1/(2k + 1)(x + 1)^2k+1 + ...] = 2 sigma_n=?^? ?, for x >0. Note that g this series converges for x > 0 only. Therefore, a program should issue an error message if the is not met by the input for x and then terminate. Create a MATLAB user-defined function as an m-file fTln.m. The function definition line must be: function y = fTln(x). Note that the summation notation in eq. (1) is incomplete. Supply a proper notation on this cover she. The function should print to screen: The number of terms used in the sum. The result. An error message if necessary: ERROR: argument must satisfy x > 0 You may wish to use any of your functions for Taylor series expansions exercised in class as a template Cln.m. Use the convergence criterion (E

Explanation / Answer

function fTln(x)
result = 0;
n = 0;
E = 10^-6;
if x>0
    while abs(result-log(x))>E
        result = result + 2*((x-1)^i)/(i*(x+1)^i);
        n = n+1;
    end
else
    error('ERROR: argument must satisfy x>0');
end
disp(['The number of terms used in the sum: ', num2str(n)]);
disp(['result = ': num2str(result)]);

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