Mathematica Lab 12

advertisement
November 21,2015
Section C
Mathematica Lab 12
Problem 1
Compute the product of the consecutive integers 4 through 9 two different ways.
One way:
4*5*6*7*8*9
60 480
An alternative way:
9
x=4 x
60 480
Problem 2
Compute the sum of the first 25 prime numbers.
25
x=1 Prime[x]
1060
Problem 3
Compute the square root of the sum of the squares of the integers 15 through 30, inclusive.
30
x=15 x2
2
2110
Problem 4
Compute the infinite sum 1 +
Printed by Wolfram Mathematica Student Edition
1
2
+
1
4
+
1
8
+
1
16
... .
1 of 5
Tal Usvyatsky
November 21, 2015
∞
x=0
Section C
Tal Usvyatsky
1
2x
2
Problem 5
Sketch the graphs of y = sin[x] , y = 2sin[x], and y = 3sin[x], for -π ≤ x ≤ π , on one set of axes.
Plot{Tooltip[y = Sin[x], "Sin[x]"],
Tooltip[y = 2 Sin[x], "2 Sin[x]"], Tooltip[y = 3 Sin[x], "3 Sin[x]"]},
{x, - π, π}, Axes  True, AxesLabel  {"x", "y"}, PlotLabel  "Sine Waves",
π π
π
π
Ticks  0,  , , π, - , - , - π, Automatic, PlotLegends  "Expressions"
2 2
2
2
Sine Waves
y
3
2
y = sin(x)
1
y = 2 sin(x)
-π
-
π
π
2
2
x
π
y = 3 sin(x)
-1
-2
-3
Problem 6
How many zeros does the function
of this problem.
f (x) = x2 - e0.1 x have? Provide a good graphical representation
Solvef[x] == x2 - 0.1 x && f[x] == 0, x
{{x  - 0.953446}, {x  1.05412}, {x  89.9951}}
The problem represented graphically:
Printed by Wolfram Mathematica Student Edition
2 of 5
November 21,2015
Section C
Tal Usvyatsky
Plotf[x] = x2 - 0.1 x , {x, - 40, 93}, Axes  True,
AxesLabel  {"x", "y"}, PlotLabel  HoldFormf[x] = x2 - 0.1` x 
f (x) = x2 - 0.1 x
y
4000
3000
2000
1000
-40
-20
20
40
60
x
80
-1000
-2000
A close up of two of the equation’s zeros:
Plotf[x] = x2 - 0.1 x , {x, - 3, 3}, Axes  True,
AxesLabel  {"x", "y"}, PlotLabel  HoldFormf[x] = x2 - 0.1` x 
f (x) = x2 - 0.1 x
y
8
6
4
2
-3
-2
-1
1
2
3
A close up of the third zero:
Printed by Wolfram Mathematica Student Edition
3 of 5
x
November 21, 2015
Section C
Tal Usvyatsky
Plotf[x] = x2 - 0.1 x , {x, 80, 95}, Axes  True,
AxesLabel  {"x", "y"}, PlotLabel  HoldFormf[x] = x2 - 0.1` x 
f (x) = x2 - 0.1 x
y
2000
82
84
86
88
90
92
94
x
-2000
-4000
Problem 7
Compute the product of the first twenty Fibonacci numbers two different ways.
Fibonorial[20]
9 692 987 370 815 489 224 102 512 784 450 560 000
Alternatively...
20
x=1 Fibonacci[x]
9 692 987 370 815 489 224 102 512 784 450 560 000
Problem 8
If 35 x+1 = 11 then x ≈ ?
Solve[Log[3, 11] == 5 x + 1, x] // N
{{x  0.236532}}
Problem 9
Compute the sum 1/2 + 2 /3 + 3/ 4 + 4/ 5 + ... + 99 /100
Printed by Wolfram Mathematica Student Edition
4 of 5
November 21,2015
99
x=1
Section C
Tal Usvyatsky
x
x+1
264 414 864 639 329 557 497 913 717 698 145 082 779 489
2 788 815 009 188 499 086 581 352 357 412 492 142 272
Problem 10
1
Compute the sum 1 + 1 + 2  + 1 +
20
1
2
1
+ 3  + ... + 1 +
x
x=1 x=1 1  x
41 054 655
739 024
Printed by Wolfram Mathematica Student Edition
5 of 5
1
2
+
1
3
+ ... +
1

20
Download