Question

Use MATLAB to determine the following integrals. a) Determine cosh r dx. (See section 1.9.1 of the MATLAB Manua. (b) Determin

0 0
Add a comment Improve this question Transcribed image text
Answer #1


Matlab code for finding integral clear all close all &Question a. syms x fprintf(a. Integration of f(x)-cosh (x) is fl (x)-cFor this function analytic integration is not possible Integration of t. 2.*sin(t) for limit /-10 101 is -0.000000. As it is

%%Matlab code for finding integral
clear all
close all

%Question a.
syms x
fprintf('a. Integration of f(x)=cosh(x) is ')
f1(x)=cosh(x);
zz=int(f1(x));
disp(zz)

%Question b.
f2(x)=x^2*exp(-6*x);
zz=int(f2(x));
fprintf('a. Integration of f(x)=x^2*exp(-6*x) is \n')
pretty(zz)

%Question c.
f3(x)=sqrt(log(x^2-1));
zz=int(f3(x));
fprintf('c. Integration of f(x)=sqrt(log(x^2-1)) is \n')
disp(zz)

fprintf('For this function analytic integration is not possible.\n')

%Question d.
fun = @(t) t.^2.*sin(t);
val=integral(fun,-10,10);
fprintf('\nIntegration of t.^2.*sin(t) for limit [-10 10] is %f.\n',val)

%plotting the function
tt=linspace(-10,10);
vv=fun(tt);
plot(tt,vv,'linewidth',2)
xlabel('t')
ylabel('f(t)')
title('t vs. f(t) plot')
fprintf('As it is odd function the integral value is 0.\n')

%%%%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%%%%

Add a comment
Know the answer?
Add Answer to:
Use MATLAB to determine the following integrals. a) Determine cosh r dx. (See section 1.9.1 of the MATLAB Manua. (b) De...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT