Chapter1

Click here to see book problems 

Problem 1
Script file:

disp(‘To show a problem solution just type ex. “problem1a”‘)
problem1a = (5-(19/7)+2.5^3)^2;
disp(‘problem1a’)
%problem 1 b
problem1b = 7*3.1+(sqrt(120)/5)-15^(5/3);
disp(‘problem1b’)
Problem 2
Script file:

%problem 2 a
problem2a = nthroot((8+(80/2.6)),3)+exp(3.5);
disp(‘problem2a’)
%problem 2 b
problem2b = ((1/sqrt(75))+(73/3.1^3))^(1/4)+55*0.41;
disp(‘problem2b’)
Problem 3
Script file:

%problem 3 a
problem3a = ((23 + (nthroot(45,3)))/(16*0.7))+ log10(589006);
disp(‘problem3a’)
%problem 3 b
problem3b = (36.1 -2.25*pi)*(exp(2.3)+sqrt(20));
disp(‘problem3b’)
Problem 4
Script file:

%problem 4 a
problem4a = ((3.8^2)/(2.75-41*25))+((5.2+1.8^5)/sqrt(3.5));
disp(‘problem4a’)
%problem 4 b
problem4b = (2.1*10^6-15.2*10^5)/(3*nthroot((6*10^11),3));
disp(‘problem4b’)
Problem 5
Script file:

%problem 5 a; note tand for calculating degrees
problem5a = (sin(0.2*pi)/cos(pi/6))+tand(72);
disp(‘problem5a’)
%problem 5 b
problem5b = (tand(64)*cosd(15))^2+(sind(37)^2/cosd(20)^2);
disp(‘problem5b’)
Problem 6
Script file:

% problem 6 a
z= 4.5;
problem6a = 0.4*z^4+3.1*z^2-162.3*z-80.7;
disp(‘problem6a’)
% problem 6 b
z= 4.5;
problem6b =(z^3-23)/(nthroot((z^2+17.5),3));
disp(‘problem6b’)
Problem 7
Script file:

% problem 7 a
t= 3.2;
problem7a = (1/2)*exp(2*t)-3.81*t^3;
disp(‘problem7a’)
% problem 7 b
t=3.2;
problem7b = (6*t^2+6*t-2)/(t^2-1);
disp(‘problem7b’)
Problem 8
Script file:

% problem 8 a
x=6.5; y=3.8;
problem8a = (x^2+y^2)^(2/3)+(x*y)/(y-x);
disp(‘problem8a’)
% problem 8 b
x=6.5; y=3.8;
problem8b = (sqrt(x+y)/(x-y)^2)+2*x^2-x*y^2;
disp(‘problem8b’)
Problem 9
Script file:

% problem 9 a
c=4.6; d=1.7; a= (c*d^2); b=(c+a)/(c-d);
problem9a = exp(d-b)+ nthroot((c+a),3) – ((c*a)^d);
disp(‘problem9a’)
% problem 9 b
c=4.6; d=1.7; a= c*d^2; b=(c+a)/(c-d);
problem9b = (d/c)+((c*t)/b)^2-c^d-(a/b);
disp(‘problem9b’)
Problem 10
Script file:

% problem 10 a
x= pi/10;
disp(‘problem10a LHS and RHS’)
LHS = cos(x)^2-sin(x)^2
RHS = 1-2*sin(x)^2
% problem 10 b
disp(‘problem 10 b LHS and RHS’)
x= pi/10;
LHS =(tan(x)/(sin(x)-2*tan(x)))
RHS =(1/(cos(x)-2))
Problem 11
Script file:

% problem 11 a
disp(‘problem 11 a’)
x=20;
LHS =(sind(x)+cosd(x))^2
RHS =(1+2*sind(x)*cosd(x))
% problem 11 b
disp(‘problem 11 b’)
x=20;
LHS =(1-2*cosd(x)-(3*(cosd(x))^2))/((sind(x))^2)
RHS = (1-3*cosd(x))/(1 – cosd(x))
Problem 12
Script file:

% problem 12 a
disp(‘Problem 12 a’)
alpha = pi / 8; beta = pi / 6;
LHS =tan(alpha + beta)
RHS=(tan(alpha)+tan(beta))/(1-tan(alpha)*tan(beta))
Problem 13
Script file:

% problem 13
disp(‘problem 13 definite integral’)
upperlimit = pi / 3;
lowerlimit = pi / 6;
upperlimitx = 2* upperlimit * cos(upperlimit) + ((upperlimit)^2-2)*sin(upperlimit);
lowerlimitx =2*lowerlimit * cos(lowerlimit)+((lowerlimit)^2-2)* sin(lowerlimit);
definiteintegral = upperlimit – lowerlimit
Problem 14
Script file:

%problem 14 a. acosd gets the arccosine in degrees
disp(‘problem 14 a. Anngle BAC’)
boxwidth = 23; boxlenght = 43; boxheight = 16;
triangleSideA = sqrt(boxwidth^2 + boxlenght^2);
triangleSideB = sqrt(boxwidth^2 + boxheight^2);
triangleSideC = sqrt(boxheight^2 + boxlenght^2);
angleBAC = acosd((triangleSideA^2 + triangleSideB^2 – triangleSideC^2) / (2 * triangleSideA * triangleSideB))
%problem 14 b
disp(‘problem 14 b. Area of triangle’)
boxwidth = 23; boxlenght = 43; boxheight = 16;
triangleSideA = sqrt(boxwidth^2 + boxlenght^2);
triangleSideB = sqrt(boxwidth^2 + boxheight^2);
triangleSideC = sqrt(boxheight^2 + boxlenght^2);
p = ( triangleSideA + triangleSideB + triangleSideC) / 2;
triangleArea = round((sqrt(p * (p – triangleSideA) * (p – triangleSideB) * (p – triangleSideC))),1)
Problem 15
Script file:

% problem 15
disp(‘problem 15 arc lenght of segment’)
a = 8; h = 13;
LABC = sqrt(a^2 + 4 * h^2) + (a^2/2*h) * log((2*h)/a + sqrt(((2*h)/a)^2 + 1))
Problem 16
Script file:

%problem 16 a
disp(‘problem 16a angle gamma in degrees’)
sidea = 10.5 + 4.5; sideb = 15 + 4.5; sidec = 15 + 10.5;
angleGamma = acosd((sidea^2 + sideb^2 – sidec^2) / (2 * sidea * sideb))
%problem 16 b
disp(‘problem 16 b’)
sidea = 10.5 + 4.5; sideb = 15 + 4.5; sidec = 15 + 10.5;
anglealpha = asind (((sind(angleGamma))/ sidec) * sidea)
anglebeta = asind (((sind(angleGamma))/sidec) * sideb)
%problem 16 c
disp(‘The summ of all angles’)
sumangles = angleGamma + anglealpha + anglebeta
Problem 17
Script file:

%problem 17
disp(‘problem 17. icecream volume’)
di = 1.25; do = 2.25; h = 2;
voulme = (pi*h)/3 *(do^2 + di^2 + (do * di))
Problem 18
Script file:

%problem 18 a
disp(‘problem 18 a’)
a = 27; b = 43; c = 57;
anglea = acos((b^2+c^2-a^2)/(2*b*c))
angleb = acos((a^2+c^2-b^2)/(2*a*c))
anglec = acos((a^2+b^2-c^2)/(2*a*b))
%problem 18 b
disp(‘problem 18 b.comparing the law of tangent’)
LHS = (b -c)/(b + c)
RHS = (tan((1/2)*(angleb – anglec)))/(tan((1/2)*(angleb + anglec)))
Problem 19
Script file:

%problem 19 a
A = 72;
B = 43;
p = 114;
syms a b c;
eqn1 = a + b + c == 144;
eqn2 = a == (sind(72)*b) / sind(43);
eqn3 = b == (sind(43)*c) / sind(65);
eqn4 = c == (sind(65)*b) / sind(43);
sol = solve([eqn1, eqn2, eqn3], [a, b, c]);
a = sol.a;
b = sol.b;
c = sol.c;
a=double(a);
b=double(b);
c=double(c);
disp(‘problem 19 a’)
s = (a+b+c)/2;
r = sqrt(((s-a)*(s-b)*(s-c))/s);
disp(‘problem 19 b’)
Problem 20
Script file:

%problem 20
disp(‘problem 20’)
xp=2; yp=6; zp= -1; xa= -2; ya= -1.5; za= -3; xb= -2.5; yb=6; zb=4;
r = sqrt((xb-xa)^2 + (yb – ya)^2 + (zb – za)^2);
sOne = (xp * ya) + (xa * yb) + (xb * yp) – ((yp * xa) + (ya * yb) + (yb * xp));
sTwo = yp*za+ya*zb+yb*zp-(zp*ya+za*yb+zb*yp);
sThree = xp*za+xa*zb+xb*zp-(zp*xa+za*xb+zb*xp);
s = sqrt(sOne^2+sTwo^2+sThree^2);
d = (2*s)/r;