# Derivative of $f(n) = n \cdot \left(1- \prod_{i=1}^n (1-\frac{1}{p_i})\right)$

I'm trying to find the derivative of $f(n)$, but don't know how to evaluate the derivative of a product.

$f(n) = n \cdot \left(1- \prod_{p<n}^n (1-\frac{1}{p})\right)$

In this case, the function contains a product of 1 minus the reciprocal of all primes up to $n$. $n$ is an integer. So far I have:

$f'(n) = 1 - (n \cdot \left( \prod_{p<n}^n (1-\frac{1}{p})\right))'$

• Is $f$ defined for numbers other than integers? presumably the product is over integers ( or primes? ) Dec 23, 2016 at 16:43
• @Callus Thanks for the clarification: I've edited the question. Dec 23, 2016 at 17:18
• Why do you want to find the derivative here? What is the underlying problem you want to solve? Some context would be good. Dec 23, 2016 at 17:19
• @Winther I have two functions and would like to find which one tends to infinity at a faster rate. The one in the question is the one I don't know how to differentiate. Dec 23, 2016 at 17:38
• Ok, then as expected this is a classical XY problem. Using derivatives is not the way to go here, I suggest trying to ask about the underlying problem instead. Dec 23, 2016 at 17:40

$\prod_{i=1}^n (1-\frac{1}{p_i})$ is constant between two consecutive integers. So it means derivative is: $f'(n) = 1 - (n \cdot \left( \prod_{i=1}^n (1-\frac{1}{p_i})\right))'=1-\prod_{i=1}^n (1-\frac{1}{p_i})$