Site hosted by Angelfire.com: Build your free website today!

Math 696 - Problem Set 2 

Miranda Ray 

 

PROBLEM ONE: 

 

> f := .1*exp(-.3*x)*(x^2-x)*sin(2*x); 1
 

.1*exp(-.3*x)*(x^2-x)*sin(2*x) 

> g := D(f); 1
 

.1*D(exp(-.3*x))*(x^2-x)*sin(2*x)+.1*exp(-.3*x)*(2*D(x)*x-D(x))*sin(2*x)+.1*exp(-.3*x)*(x^2-x)*D(sin(2*x))
.1*D(exp(-.3*x))*(x^2-x)*sin(2*x)+.1*exp(-.3*x)*(2*D(x)*x-D(x))*sin(2*x)+.1*exp(-.3*x)*(x^2-x)*D(sin(2*x))
 

> h := D(g); 1
 

.1*(`@@`(D, 2))(exp(-.3*x))*(x^2-x)*sin(2*x)+.2*D(exp(-.3*x))*(2*D(x)*x-D(x))*sin(2*x)+.2*D(exp(-.3*x))*(x^2-x)*D(sin(2*x))+.1*exp(-.3*x)*(2*(`@@`(D, 2))(x)*x+2*D(x)^2-(`@@`(D, 2))(x))*sin(2*x)+.2*exp...
.1*(`@@`(D, 2))(exp(-.3*x))*(x^2-x)*sin(2*x)+.2*D(exp(-.3*x))*(2*D(x)*x-D(x))*sin(2*x)+.2*D(exp(-.3*x))*(x^2-x)*D(sin(2*x))+.1*exp(-.3*x)*(2*(`@@`(D, 2))(x)*x+2*D(x)^2-(`@@`(D, 2))(x))*sin(2*x)+.2*exp...
.1*(`@@`(D, 2))(exp(-.3*x))*(x^2-x)*sin(2*x)+.2*D(exp(-.3*x))*(2*D(x)*x-D(x))*sin(2*x)+.2*D(exp(-.3*x))*(x^2-x)*D(sin(2*x))+.1*exp(-.3*x)*(2*(`@@`(D, 2))(x)*x+2*D(x)^2-(`@@`(D, 2))(x))*sin(2*x)+.2*exp...
.1*(`@@`(D, 2))(exp(-.3*x))*(x^2-x)*sin(2*x)+.2*D(exp(-.3*x))*(2*D(x)*x-D(x))*sin(2*x)+.2*D(exp(-.3*x))*(x^2-x)*D(sin(2*x))+.1*exp(-.3*x)*(2*(`@@`(D, 2))(x)*x+2*D(x)^2-(`@@`(D, 2))(x))*sin(2*x)+.2*exp...
.1*(`@@`(D, 2))(exp(-.3*x))*(x^2-x)*sin(2*x)+.2*D(exp(-.3*x))*(2*D(x)*x-D(x))*sin(2*x)+.2*D(exp(-.3*x))*(x^2-x)*D(sin(2*x))+.1*exp(-.3*x)*(2*(`@@`(D, 2))(x)*x+2*D(x)^2-(`@@`(D, 2))(x))*sin(2*x)+.2*exp...
 

> plot([f, g, h], x = -3 .. 2, y = -6 .. 6, color = ([red, green, magenta])); 1
 

Warning, unable to evaluate 1 of the 3 functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct 

Plot 

PROBLEM TWO: 

> f := .1*x = 1.2; -1
 

> fsolve(f, x = 0 .. 12); 1
 

12. 

> g := x*sin(x) = 1.2; -1
 

> fsolve(g, x = 0 .. 12); 1
 

6.469744336 

> NextAfter(6.469744336, infinity)
 

6.469744337 

PROBLEM THREE: 

 

> isprime(32767); 1
 

false 

> isprime(65535); 1
 

false 

> isprime(131071); 1
 

true 

> isprime(262143); 1
 

false 

> isprime(524287); 1
 

true 

> isprime(1048575); 1
 

false 

> isprime(2097151); 1
 

false 

> isprime(4194303); 1
 

false 

> isprime(8388607); 1
 

false 

PROBLEM FOUR: 

 

> f := product(x^2-k+m, k = 1 .. m); 1
 

-(-1)^(m+1)*GAMMA(1-x^2)/GAMMA(1-x^2-m) 

> for m to 5 do expand(f) end do; 1
 

x^2 

x^2+x^4 

2*x^2+3*x^4+x^6 

6*x^2+11*x^4+6*x^6+x^8 

24*x^2+50*x^4+35*x^6+10*x^8+x^10 

PROBLEM FIVE: 

 

> evalf[500](Pi); 1
 

3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381...
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381...
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381...
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381...
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381...
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381...
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381...
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381...
 

PROBLEM SIX: 

 

> with*plottools; -1
 

> with(plot)
 

> c1 := circle([0, 0], 1, color = blue); -1
 

> c2 := circle([0, 0], 2, color = red); -1
 

> c3 := circle([0, 0], 3, color = green); -1
 

> c4 := circle([0, 0], 4, color = black); -1
 

> c5 := circle([0, 0], 5, color = magenta); -1
 

> display(c1, c2, c3, c4, c5); 1
 

Plot 

>