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))'$

  • 2
    $\begingroup$ Is $f$ defined for numbers other than integers? presumably the product is over integers ( or primes? ) $\endgroup$ Dec 23, 2016 at 16:43
  • $\begingroup$ @Callus Thanks for the clarification: I've edited the question. $\endgroup$ Dec 23, 2016 at 17:18
  • $\begingroup$ Why do you want to find the derivative here? What is the underlying problem you want to solve? Some context would be good. $\endgroup$
    – Winther
    Dec 23, 2016 at 17:19
  • $\begingroup$ @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. $\endgroup$ Dec 23, 2016 at 17:38
  • 1
    $\begingroup$ 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. $\endgroup$
    – Winther
    Dec 23, 2016 at 17:40

1 Answer 1


Derivative of 1 is 0 and derivative of n*constant is constant.

$\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})$

It is valid for all real n except discontinuities at n integer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.