Calculating a function given a certain x range.

28 Views Asked by At

I have the function $f(x) = x^3 + 1$

and I want to calculate the following:

$f(x) = (\frac{a}{25})^3 + 1 $

Where "$a$" is 1,2,3,4,..,50.

1 through 50

Basically I'm adding up $f(1) + f(2) + f(3) + f(4),+..,f(50)$

I want to know if there a easier way of doing this instead of just adding each number on your calculator.

2

There are 2 best solutions below

2
On BEST ANSWER

It turns out that $$ \sum_{n=1}^Nn^3=\frac{N^2(N+1)^2}{4} $$ for all natural numbers $N$, hence $$ \sum_{n=1}^{50}f\Big(\frac{n}{25}\Big)=\sum_{n=1}^{50}\Big[\frac{n^3}{25^3}+1\Big]=50+\frac{1}{25^3}\sum_{n=1}^{50}n^3=50+\frac{50^2\cdot 51^2}{4\cdot 25^3}$$

3
On

There is an identity $$\sum_{a=1}^n a^3=\left(\frac{n(n+1)}{2}\right)^2.$$ We can apply that here: $$\sum_{a=1}^{50}\left(\frac{a}{25}\right)^3=50+\frac{1}{25^3}\sum_{a=1}^{50} a^3=50+\frac{1}{25^3}\left(\frac{50\times 51}{2}\right)^2=50+\frac{51^2}{25}.$$ You can put that in your calculator, and do just one calculation.