Project

Matlab coding of topics from CO2 to CO4.

MATH147
2Q1819
Course Outcome 2
  • Integrals of Trigonometric Functions
  • syms x
    int(5*(sec(pi*x))^2)

  • Integration by Trigonometric Substitution
  • syms x
    int(x^2/sqrt(4+x^2))

  • Integration by Parts
  • syms x
    int((exp(2*x))*(x^3+x^2+2*x-1))



    Course Outcome 3
  • Definite Integral
  • syms x
    int(((x^7+1)*(3*x^2+1)),-2,2)

  • Improper Integral
  • syms x
    int(1/sqrt(4-x^2),0,2)
    
    f(x)=(1/sqrt(4-x.^2));
    fplot(1/sqrt(4-x^2),[0,2])
    daspect([1 5 1]);
    line([2.1,2.1], [0.0]);
    grid on

  • Area under a cuve
  • syms x
    int((x^2),1,2)
    
    y = @(x) (x.^2);
    x = linspace(0, 1);
    
    inty = cumtrapz(x,y(x));
    figure(1)
    plot(x, inty, '-k', 'LineWidth', 2)
    hold on
    patch([x fliplr(x)], [zeros(size(x)) fliplr(inty)], 'b')
    grid



    Course Outcome 4
  • Doube integration over nonrectangular regions
  • syms x y
    int(int(exp(-y^2),y,4*x,4),x,0,1)
    
    clear all, close all; clc
    x = 0 : 1;
    curve1 = 4+0*x;
    curve2 = 4*x;
    hold on;
    x2 = [x, fliplr(x)];
    inBetween = [curve1, fliplr(curve2)];
    fill(x2, inBetween, 'b');
    plot(x, curve2, 'r', 'LineWidth', 2);
    plot(x, curve1, 'r', 'LineWidth', 2);
    grid

  • Double Integration
  • syms x y
    int(int(exp(x+y),x,0,x),y,0,1)

  • Triple integration
  • syms x y z
    int(int(int(z*(sin(x)+cos(y)),z,0,1),y,0,pi/2),x,0,pi)