Question

Use Matlab to evaluate the integral ∫x^2dx from 0 to 1 using successive summation. Use discrete...

Use Matlab to evaluate the integral ∫x^2dx from 0 to 1 using successive summation.

Use discrete trapezoids to compute integral (do not use automated commands).

Homework Answers

Answer #1

clc;clear all
format long
integ=@(x) x.^2;
a=input('Enter the lower limit');
b=input('Enter the upper limit');
n=input('Enter the subdivisions(>1)');
ans1=trapezoidal(integ,a,b,n);
fprintf('Value of the integral from a=%d to b=%d using %d equally spaced interval is %5.6f\n',a,b,n,ans1)
function answert=trapezoidal(f,a,b,n) %%Function which implements Trapezoidal rule
I(1)=f(a); I(n+1)=f(b);
h=(b-a)/n;
x=a:h:b;
I(2:n)=2*f(x(2:(length(x)-1)));
answert=0.5*h*sum(I);
end

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Use Stokes' Theorem to evaluate the integral ∮CF⋅dr=∮C8z^2dx+8xdy+2y^3dz where C is the circle x^2+y^2=9 in the...
Use Stokes' Theorem to evaluate the integral ∮CF⋅dr=∮C8z^2dx+8xdy+2y^3dz where C is the circle x^2+y^2=9 in the plane z=0 .
Evaluate the iterated integral. int from 0 to 1 , int from 0 to x^7 sqrt(1-x^8)...
Evaluate the iterated integral. int from 0 to 1 , int from 0 to x^7 sqrt(1-x^8) dy dx
Evaluate double integral Z 2 0 Z 1 y/2 cos(x^2 )dx dy (integral from 0 to...
Evaluate double integral Z 2 0 Z 1 y/2 cos(x^2 )dx dy (integral from 0 to 2)(integral from y/2 to 1) for cos(x^2) dx dy
Summation from n=2 to infinity of ln(n)/n^2 * x^n a.) Let x=-1, and compute the integral...
Summation from n=2 to infinity of ln(n)/n^2 * x^n a.) Let x=-1, and compute the integral test to determine whether this it is convergent or divergent b.) Compute the ratio test to determine the interval of convergence and explain what this interval represents. I'm really confused with this problem (specifically a)- please write out all of the details of computing the integral so I can understand. Thank you!
Rewrite the following integral using the indicated order of integration and then evaluate the resulting integral....
Rewrite the following integral using the indicated order of integration and then evaluate the resulting integral. Integral from 0 to 3 Integral from negative 1 to 0 Integral from 0 to 4 x plus 4 dy dx dz in the order of dz dx dy
Using Matlab, evaluate ? = (? + 10) (?^5 + 1) for values of x in...
Using Matlab, evaluate ? = (? + 10) (?^5 + 1) for values of x in the range of -1 to 1 in step sizes of 0.1. Hence, plot y versus x. Could you also include the Matlab code and the associated screenshots?
Evaluate the integral using integration by parts with the indicated choices of u and dv. (Use...
Evaluate the integral using integration by parts with the indicated choices of u and dv. (Use C for the constant of integration.) xe5xdx;    u = x,  dv = e5xdx 2. Evaluate the integral. (Use C for the constant of integration.) (x2 + 10x) cos(x) dx 3. Evaluate the integral. (Use C for the constant of integration.) cos−1(x) dx 4. Evaluate the integral. (Use C for the constant of integration.) ln( x ) dx
1. Evaluate the definite integral given below. ∫(from 0 to π/3) (2sin(x)+3cos(x)) dx 2. Given F(x)...
1. Evaluate the definite integral given below. ∫(from 0 to π/3) (2sin(x)+3cos(x)) dx 2. Given F(x) below, find F′(x). F(x)=∫(from 2 to ln(x)) (t^2+9)dt 3. Evaluate the definite integral given below. ∫(from 0 to 2) (−5x^3/4 + 2x^1/4)dx
Evaluate the integral using trig substitution. definite integral from 1 to sqrt(2) 6 / (x^2 sqrt(4-x^2))dx...
Evaluate the integral using trig substitution. definite integral from 1 to sqrt(2) 6 / (x^2 sqrt(4-x^2))dx (a) write the definition for x using the triangle (b) write the new integral before any simplification (c) write the new integral after simplifying and in the form ready to integrate (d) write the solution in simplified exact form write all answers next to the specified letter above
Problem 1 f(x) = ex * cos(x) Evaluate the integral of f(x) from x = -...
Problem 1 f(x) = ex * cos(x) Evaluate the integral of f(x) from x = - Π / 2 to x = + Π / 2 using: 1. Trapezoidal Rule where Δx = Π / 6 2. Simpson's 1/3 Rule where n = 4 3. Simpson's 3/8 Rule 4. Draw a scatter plot of f(x) in Excel over the desired range (use sufficient data points to accurately depict the function) 5a. What is the true solution? (evaluate the integral) 5b....