%% Problem 8

%% Initializations
syms x real     % define x as a real symbolic variable
format compact  % eliminates blank lines in output
format long g   % show all digits of numerical output

%% (a)
a = int( exp(-3*x)*sin(x), x)
simplify(a)

%% (b)
a = int( (x+1)*log(x), x)
simplify(a)

%% (c) 
% This is a definite integral for x=0 to 1:
I = int( sqrt(x/(1-x)), x, 0, 1 )

%% (d)
% Use Inf for infinity:
I = int(exp(-x^2), x, -Inf, Inf)

%% (e)
I = int(sqrt(1+x^4), x, 0, 1)     % symbolic answer
double(I)                         % numerical value of symbolic answer
Q = quadl('sqrt(1+x.^4)',0,1)     % approximate answer using numerical integration
                                  % need ".^" here

