1 Summations
1.1 Solution 1
1.1.1 Solution a
From theorem 5.1.1, we can rewrite them as individual summations:
i, n = var('i,n') a = sum(i^2, i , 1, n) a b = sum(-2*i, i, 1, n) b c = sum(3, i, 1, n) c d = a + b + c d d.factor()
1/3*n^3 + 1/2*n^2 + 1/6*n -n^2 - n 3*n 1/3*n^3 - 1/2*n^2 + 13/6*n 1/6*(2*n^2 - 3*n + 13)*n
We can indeed confirm the result:
i,n = var('i n') f = i^2 - (2*i) + 3 sum(f(i), i, 1, n).factor()
1/6*(2*n^2 - 3*n + 13)*n
1.1.2 Solution b
sum((i^2 - (2*i) + 3), i, 1, 5)
40
f f(1) + f(2) + f(3) + f(4) + f(5)
i^2 - 2*i + 3 40
1.2 Solution 2
From theorem 5.1.1 and results from 1.4, we can rewrite them as individual summations:
i, n = var('i n') f = i^3 - (4*i) a = sum(i^3, i, 1, n).factor() b = sum((-4*i),i,1,n).factor() (a + b).factor()
1/4*(n^2 + n - 8)*(n + 1)*n
Let's check our solution:
sum(f,i,1,n).factor()
1/4*(n^2 + n - 8)*(n + 1)*n
1.3 Solution 3
From theorem 5.1.1 and results from 1.4, we can rewrite them as individual summations:
j, n = var('j n') a = sum(2*(j^3), j, 1, n) b = sum(-1*j, j, 1, n) (a - b).factor()
1/2*(n^2 + n + 1)*(n + 1)*n
1.4 Solution 4
From theorem 5.1.1 and results from 1.4, we can rewrite them as individual summations:
i, t = var('i t') a = sum(3 * (i^2), i, 1, t) b = sum(-i, i, 1, t) c = sum(2, i, 1, t) (a + b + c).factor()
(t^2 + t + 2)*t
Let's verify the solution:
f = 3*(i^2) - i + 2 sum(f(i), i, 1, n).factor()
(n^2 + n + 2)*n
1.5 Solution 5
Let's expand \((1+1)^3\):
i = var('i') ((i+1)^3).expand()
i^3 + 3*i^2 + 3*i + 1
Now from theorem 5.1.1 and results from 1.4, we can rewrite them as individual summations:
i = var(i) a = sum(i^3, i, 1, n) b = sum(3*(i^2), i, 1, n) c = sum(3*i, i, 1, n) d = sum(1, i, 1, n) (a+b+c+d).factor()
1/4*(n^2 + 3*n + 4)*(n + 3)*n
1.6 Solution 6
Let's find the solution from \(i = 1\) to \(i = n+3\) in this case:
i, n = var('i n') whole = sum(i^2, i, 1, n+3).factor() whole
1/6*(2*n + 7)*(n + 4)*(n + 3)
Now let's compute the summation from \(i = 1\) to \(i = 4\):
till_4 = sum(i^2, i, 1, 4) till_4
30
The final solution is:
(whole - till_4).factor()
1/6*(2*n^2 + 23*n + 96)*(n - 1)
Let's verify the solution:
i, n = var('i n') sum(i^2, i, 5, (n+3)).factor()
1/6*(2*n^2 + 23*n + 96)*(n - 1)
1.7 Solution 7
1.7.1 Solution a
Now from theorem 5.1.1 and results from 1.4, we can rewrite them as individual summations:
i, n = var('i n') a = sum(i^2, i, 1, n) b = sum(5*i, i, 1, n) (a+b).factor()
1/3*(n + 8)*(n + 1)*n
1.7.2 Solution b
Now from theorem 5.1.1 and results from 1.4, we can rewrite them as individual summations. Let's find the sum from \(j = 1\) to \(n+5\)
j, n = var('j n') a = sum(j^2, j, 1, n+5) b = sum(-5*j, j, 1, n+5) (a + b).factor()
1/3*(n + 6)*(n + 5)*(n - 2)
Now let's compute the same sum from \(j = 1\) to \(5\):
a1 = sum(j^2, j, 1, 5) b1 = sum(-5*j, j, 1, 5) (a + b - a1 - b1).factor()
1/3*(n + 8)*(n + 1)*n
1.7.3 Solution c
We have already shown from (a) and (b) that they are equal. Let's expand them:
i = var(i) f = i^2 + 5*i [f(1) , f(2) , f(3) , f(n).factor()] g = j^2 - 5*j [g(6), g(7), g(8), g(n+6).factor()]
[6, 14, 24, (n + 5)*n] [6, 14, 24, (n + 6)*(n + 1)]
We can see how each of them expand to the same value when started from their staring interval. That's why both come to the same value:
f(n).factor() g(n+5).factor()
(n + 5)*n (n + 5)*n
1.8 Solution 8
1.8.1 Part one
We need to prove this:
\(\sum_{i=1}^n (ca_i) = ca_1 + ca_2 + ... + ca_n = c(a_1 + a_2 + ... + a_n) = c\sum_{i=1}^n a_i\)
We will prove using mathematical induction.
Base case: \(n= 1\)
\(\sum_{i=1}^n ca_i = ca_1\)
Induction step: Suppose \(\sum_{i=1}^n (ca_i) = c\sum_{i=1}^n a_i\)
\(\sum_{i=1}^{n+1} (ca_i) = \sum_{i=1}^n (ca_i) + ca_{n+1}\)
\(= c\sum_{i=1}^n a_i + ca_{n+1}\) (Induction case)
\(= c(\sum_{i=1}^n a_i + a_{n+1})\)
\(= c(\sum_{i=1}^{n+1} a_i)\)
This completes the mathematical induction proof.
1.8.2 Part two
We need to prove this:
\(\sum_{i=1}^n (a_i + b_i) = \sum_{i=1}^n a_i + \sum_{i=1}^n b_i\)
We will prove using mathematical induction.
Base case: \(n = 1\)
\(\sum_{i=1}^n (a_i + b_i) = a_i + b_i\)
Induction step: Suppose \(\sum_{i=1}^n (a_i + b_i) = \sum_{i=1}^n a_i + \sum_{i=1}^n b_i\)
\(\sum_{i=1}^{n+1} (a_i + b_i)\)
\(= \sum_{i=1}^{n} (a_i + b_i) + a_{n+1} + b_{n+1}\)
\(= \sum_{i=1}^n a_i + \sum_{i=1}^n b_i + a_{n+1} + b_{n+1}\)
\(= \sum_{i=1}^n a_{i+1} + \sum_{i=1}^n b_{i+1}\)
\(= \sum_{i=1}^{n+1} a_{i} + \sum_{i=1}^{n+1} b_{i}\)
This completes the mathematical induction proof.
1.9 Solution 9
\(\sum_{i=1}^n [(i+1)^4 - i^4]\)
We need to derive equation 5.9 using the above equation.
Let's first expand the above equation:
i = var('i') f1 = (i+1)^4 f2 = -i^4 [f1(1), f2(1), f1(2), f2(2), f1(3), f2(3), f1(4), f2(4), f1(i-1), f2(i-1), f1(i), f2(i)]
[16, -1, 81, -16, 256, -81, 625, -256, i^4, -(i - 1)^4, (i + 1)^4, -i^4]
You can see that the first term is cancelled by the fourth term. The third term is cancelled by two terms following it. So apart from \(-1\) and \((i+1)^4\) everything else is cancelled.
So, \(\sum_{i=1}^n [(i+1)^4 - i^4] = (i+1)^4 - 1\)
We also know that:
x = (i+1)^4 - i^4 x.simplify_full()
4*i^3 + 6*i^2 + 4*i + 1
So, \(\sum_{i=1}^n [(i+1)^4 - i^4] = \sum_{i=1}^n(4*i^3 + 6*i^2 + 4i + 1)\)
Combining both the equations:
\((i+1)^4 - 1 = 4. \sum_{i=1}^n i^3 + \sum{i=1}^n(6*i^2 + 4*i + 1)\)
sum(((6*i^2) + (4*i) + 1), i, 1, n)
2*n^3 + 5*n^2 + 4*n
Reducing it further:
\((n+1)^4 - 1 = 4. \sum_{i=1}^n i^3 + 2*n^3 + 5*n^2 + 4n\)
\(4\sum_{i=1}^n i^3 = (n+1)^4 - 1 - 2*n^3 - 5*n^2 - 4n\)
Reducing the equations:
n = var('n') ((n+1)^4 - 1 - (2*n^3) - (5*n^2) - (4*n)).factor()
(n + 1)^2*n^2
So, \(\sum_{i=1}^n i^3 = \dfrac{n^2(n+1)^2}{4}\)
1.10 Solution 10
We need to find alternative derivation of equation 5.4 by evaulating \(\sum_{i=1}^n [(i+1)^2-i^2]\)
Let's first expand the equation:
i = var(i) f1 = (i+1)^2 f2 = -i^2 [f1(1), f2(1), f1(2), f2(2), f1(3), f2(3), f1(i-1), f2(i-1), f1(i), f2(i)]
[4, -1, 9, -4, 16, -9, i^2, -(i - 1)^2, (i + 1)^2, -i^2]
Apart from \(-1\) and \((i+1)^2\) everything else gets cancelled out.
So, \(\sum_{i=1}^n [(i+1)^2-i^2] = (n+1)^2 - 1\)
We also know that:
((i+1)^2 - i^2).simplify_full()
2*i + 1
So, \(\sum_{i=1}^n [(i+1)^2-i^2] = \sum_{i=1}^n 2i + 1\)
Combining both the equations:
\((n+1)^2 - 1 = \sum_{i=1}^n 2i + 1\)
\(\sum_{i=1}^n i = \dfrac{(n+1)^2 - n}{2}\)
((n+1)^2 - n - 1).simplify_full()
n^2 + n
So, \(\sum_{i=1}^n i = \dfrac{n^2 + n}{2}\)
1.11 Solution 11
We need to prove \(\sum_{i=1}^n i = \dfrac{n^2 + n}{2}\)
We will prove using mathematical induction.
Base case: \(n = 1\)
\(\sum_{i=1}^n i = \dfrac{1 + 1}{2} = \dfrac{1}{1} = 1\)
\(\sum_{i=1}^1 = 1\)
The base case holds.
Induction step: Suppose \(\sum_{i=1}^n i = \dfrac{n^2 + n}{2}\).
\(\sum_{i=1}^{n+1} i = \sum_{i=1}^n i + (n+1)\)
\(\sum_{i=1}^{n+1} i = \dfrac{n^2 + n}{2} + (n+1)\) (Induction step)
(((n^2 + n)/2) + (n+1)).factor()
1/2*(n + 2)*(n + 1)
((n+1)*(n+2)).simplify_full()
n^2 + 3*n + 2
So, \(\sum_{i=1}^{n+1} i = \dfrac{(n+1)^2 + (1+n)}{2}\)
This completes the mathematical induction proof.
1.12 Solution 12
1.12.1 Solution a
\(\sum_{i=1}^n \dfrac{1}{i(i+1)}\)
i, n = var('i n') f = (1/(i*(i+1))) [sum(f(i), i, 1, 1), sum(f(i), i, 1, 2), sum(f(i), i, 1, 3), sum(f(i), i, 1, 4)]
[1/2, 2/3, 3/4, 4/5]
So, I'm guessing the formula for the sum as:
\(\dfrac{n}{n+1}\)
Let's try to prove it using mathematical induction.
Base case: \(n = 1\)
\(\sum_{i=1}^n \dfrac{1}{i(i+1)} = \dfrac{1}{1(1+1)} = \dfrac{1}{2}\)
\(\dfrac{n}{n+1} = \dfrac{1}{2}\)
The base case holds.
Induction step: Suppose \(\sum_{i=1}^n \dfrac{1}{i(i+1)} = \dfrac{n}{n+1}\)
\(\sum_{i=1}^{n+1} \dfrac{1}{i(i+1)} = \sum_{i=1}^n \dfrac{1}{i(i+1)} + \dfrac{1}{(n+1)(n+2)}\)
\(= \dfrac{n}{n+1} + \dfrac{1}{(n+1)(n+2)}\) (Induction step)
\(= \dfrac{1}{n+1}(n + \dfrac{1}{n+2})\)
\(= \dfrac{1}{n+1} \dfrac{n^2 + 2n + 1}{n+2}\)
\(= \dfrac{1}{n+1} \dfrac{(n+1)^2}{n+2}\)
\(= \dfrac{n+1}{n+2}\)
So, \(\sum_{i=1}^{n+1} \dfrac{1}{i(i+1)} = \dfrac{n+1}{n+2}\)
This completes the mathematical induction proof.
We can also verify this using SageMath that our guessed formula is right:
sum(f(i),i,1,n)
n/(n + 1)
1.12.2 Solution b
We need to verify that \(\dfrac{1}{i+1} = \dfrac{1}{i} - \dfrac{1}{i+1}\)
\(\dfrac{1}{i} - \dfrac{1}{i+1}\)
\(= \dfrac{i+1-1}{i(i+1)}\)
\(= \dfrac{i}{i(i+1)}\)
\(= \dfrac{1}{i+1}\)
Now let's use this fact to write part(a) as telescoping sum.
i = var(i) f1 = (1/i) f2 = - (1/(i+1)) [f1(1), f2(1), f1(2), f2(2), f1(3), f2(3), f1(n-1), f2(n-1), f1(n), f2(n)]
[1, -1/2, 1/2, -1/3, 1/3, -1/4, 1/(n - 1), -1/n, 1/n, -1/(n + 1)]
We can see how all the terms cancel out except the first one and the last term. So,
\(\sum_{i=1}^{n} \dfrac{1}{i(i+1)} = 1 - \dfrac{1}{n+1}\)
\(= \dfrac{n}{n+1}\)
1.13 Solution 13
Suppose \(r\) is a real number and \(r \neq 1\)
1.13.1 Solution a
\(\sum_{i=1}^n [r^{i+1} - r^i]\)
i,r = var('i r') f1 = r^(i+1) f2 = -r^i [f1(r=r,i=1), f2(r=r,i=1), f1(r=r,i=2), f2(r=r,i=2), f1(r=r,i=3), f2(r=r,i=3), f1(r=r,i=n-1), f2(r=r,i=n-1), f1(r=r,i=n), f2(r=r,i=n)]
[r^2, -r, r^3, -r^2, r^4, -r^3, r^n, -r^(n - 1), r^(n + 1), -r^n]
Some observations:
- First term is cancelled with the fourth term
- Third term is cancelled with the sixth term
- Second term is not cancelled
- Second term from the last is not cancelled
So, \(\sum_{i=1}^n [r^{i+1} - r^i] = r^{n+1} - r\)
Let's verify the solution using SageMath:
sum(r^(i+1) - r^i, i, 1, n)
r^(n + 1) - r
1.13.2 Solution b
\(\sum_{i=1}^n [(r-1)r^i] = (r-1)\sum_{i=1}^n r^i\)
We need to find the formula for \(\sum_{i=1}^n r^i\)
We know from (a) that \(\sum_{i=1}^n [r^{i+1} - r^i] = r^{n+1} - r\).
So, \(r^{n+1} - r = (r-1)\sum_{i=1}^n r^i\)
\(\sum_{i=1}^n r^i = \dfrac{r^{n+1} - r}{r-1}\)
1.13.3 Solution c
\(\sum_{i=1}^n (\dfrac{1}{2})^i\)
Using the formula from (b),
r, n = var('r n') f = (r^(n+1) - r)/(r - 1) f(r=(1/2)).simplify()
-1/2^n + 1
1.14 Solution 14
\(\sum_{i=1}^n i2^i = 2 + (n-1)2^{n+1}\)
Let's prove it using mathematical induction.
Base case: \(n = 1\)
\(\sum_{i=1}^n i2^i = 1.2^1 = 2\)
\(2 + (n-1)2^{n+1} = 2 + 0 = 2\)
The base case holds.
Induction case:
Suppose \(\sum_{i=1}^n i2^i = 2 + (n-1)2^{n+1}\).
\(\sum_{i=1}^{n+1} i2^i = \sum_{i=1}^n i2^i + (n+1)2^{n+1}\)
\(= 2 + (n-1)2^{n+1} + (n+1)2^{n+1}\) (Induction step)
\(= 2 + 2^{n+1}(n-1+n+1)\)
\(= 2 + 2^{n+1}(2n)\)
\(= 2 + n2^{n+2}\)
So, \(\sum_{i=1}^{n+1} i2^i = 2 + n2^{n+2}\)
This completes the mathematical induction proof.
1.15 Solution 15
Suppose \(\sin (\dfrac{\theta}{2}) \neq 0\) We need to prove that
\(\sum_{i=1}^n \cos(i\theta) = \dfrac{\cos(\dfrac{(n+1)\theta}{2}) \sin(\dfrac{n\theta}{2})}{\sin(\theta / 2)}\)
Let's prove it using mathematical induction.
Base case: \(n = 1\)
\(\sum_{i=1}^n \cos(i\theta) = cos (\theta)\)
\(\dfrac{\cos(\dfrac{(n+1)\theta}{2}) \sin(\dfrac{n\theta}{2})}{\sin(\theta / 2)} = \dfrac{\cos(\theta) \sin(\theta / 2)}{\sin(\theta / 2)} = \cos(\theta)\)
The base case holds.
Inducation case:
Suppose \(\sum_{i=1}^n \cos(i\theta) = \dfrac{\cos(\dfrac{(n+1)\theta}{2}) \sin(\dfrac{n\theta}{2})}{\sin(\theta / 2)}\)
\(\sum_{i=1}^{n+1} \cos(i\theta) = \sum_{i=1}^{n} \cos(i\theta) + cos((n+1) \theta)\)
\(= \dfrac{\cos(\dfrac{(n+1)\theta}{2}) \sin(\dfrac{n\theta}{2})}{\sin(\theta / 2)} + cos((n+1) \theta)\)
We know that \(\cos u \sin v = \dfrac{1}{2}[\sin(u+v)-\sin(u-v)]\)
\(\cos(\dfrac{(n+1)\theta}{2}) \sin(\dfrac{n\theta}{2}) = \dfrac{1}{2}[\sin(\dfrac{(n+1)\theta}{2} + \dfrac{n\theta}{2}) - \sin(\dfrac{(n+1)\theta}{2} - \dfrac{n\theta}{2})]\)
\(= \dfrac{1}{2}[\sin(\dfrac{(2n + 1)\theta}{2}) - \sin(\dfrac{\theta}{2})]\)
Dividing the above equation by \(\sin (\theta / 2)\)
\(= \dfrac{1}{2}\dfrac{\sin(\dfrac{(2n + 1)\theta}{2})}{\sin(\dfrac{\theta}{2})} - \dfrac{1}{2}\)
Combining it with the orignal equation:
\(= \dfrac{1}{2}\dfrac{\sin(\dfrac{(2n + 1)\theta}{2})}{\sin(\dfrac{\theta}{2})} - \dfrac{1}{2} + \cos((n+1) \theta)\)
n, x = var('n x') a = sin(((2*n + 1)*x)/2) b = sin(x/2) c = 1/2 * (a/b) assume(b > 0) f = c - (1/2) + cos((n + 1)*x) f.simplify_full()
1/2*(2*cos((n + 1)*x)*sin(1/2*x) + sin(1/2*(2*n + 1)*x) - sin(1/2*x))/sin(1/2*x)
(todo: Fix this proof)