Project Set 2
Matlab coding of topics from CO2 to CO4 Set 2
MATH147
2Q1819Info! Broken links? Email us at gtechphofficial@gmail.com
Course Outcome 2
syms x
int(1/(5+2*exp(x)))
syms x
int((csc(x)^8)*(cot(x)^2))
syms x
int((exp(x))*(sqrt(9-exp(2*x))))
Course Outcome 3
syms x
int(((x^2 + 2*x + 3)/(x^3+3*x^2+3*x)),1, 5)
syms x
int(abs(x^2 + 6*x + 8),-8,4)
f(x)=abs(x^2 + 6*x + 8);
fplot(abs(x^2 + 6*x + 8),[-10,6])
daspect([1 8 1]);
grid on
%line([-1,-1],[0,0]);
line([7,7],[-5,0]);
syms x
int((3-sqrt(x)),0,9)
y = @(x) (3-sqrt(x));
x = linspace(0, 9);
inty = cumtrapz(x,y(x));
figure(1)
plot(x, inty, '-k', 'LineWidth',1)
hold on
patch([x fliplr(x)], [zeros(size(x)) fliplr(inty)], 'g')
hold off
grid
Course Outcome 4
syms x y
int(int(sqrt(x+y),x,0,3*y),y,0,1)
syms x y z
int(int(int(x*y*z,z,1,y),y,-1,x^2),x,0,2)
syms x y
int(int(x,y,exp(x),exp(2)),x,0,2)
round(int(int(x,y,exp(x),exp(2)),x,0,2)) %Rounded answer
clear all, close all; clc
x = 0 : 2;
curve1 = exp(x);
curve2 = exp(2)+0*x;
plot(x, curve2, 'b', 'LineWidth', 1);
hold on;
plot(x, curve1, 'b', 'LineWidth', 1);
x2 = [x, fliplr(x)];
inBetween = [curve1, fliplr(curve2)];
fill(x2, inBetween, 'g');
grid