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

f(x) = integral_0^1 1/(x + e^x)dx Find the following: 1. Find the Taylor series

ID: 2321948 • Letter: F

Question

f(x) = integral_0^1 1/(x + e^x)dx Find the following: 1. Find the Taylor series expansion of 1/(x+e^x) at x=1 of degree 4. 2. Plot 1/(x+e^x) and its Taylor series approximation of degree 4 on the same graph for x=1 in the range of [-pi, pi]. 3. Add Taylor series of degree 6, 7, and 8 to the same plot. 4. Find the integration of 1/(x+e^x) using Taylor series of degree 6. Integrate using "Taylor command" directly. 5. Repeat part 4 but this time use summation method. 6. Find the anti-derivative (integration) of f(x) without using Taylor series expansion. Please note when finding the anti-derivative, you are trying to evaluate the indefinite integral of f(x) using int command.

Explanation / Answer

Matlab Code

syms x
f = @(x)1/(x+exp(x));
t4 = taylor(f,x,'ExpansionPoint',1,'Order',4)
t6 = taylor(f,x,'ExpansionPoint',1,'Order',6);
t7 = taylor(f,x,'ExpansionPoint',1,'Order',7);
t8 = taylor(f,x,'ExpansionPoint',1,'Order',8);
figure(1)
hold all
xlim([-pi pi]);
t4 = matlabFunction(t4);
t6 = matlabFunction(t6);
t7 = matlabFunction(t7);
t8 = matlabFunction(t8);
x = -pi:0.01:pi;
fplot(f,[-pi pi],'b')
fplot(t4,[-pi pi],'r')
fplot(t6,[-pi pi],'c')
fplot(t7,[-pi pi],'y')
fplot(t8,[-pi pi],'m')
legend('Original Function','4th Order','6th Order','7th Order','8th Order');