Showing posts with label differentiation. Show all posts
Showing posts with label differentiation. Show all posts

Saturday, 7 June 2025

Dangers of Differentiation

The following shows an interesting line of reasoning posed by Math Lazy Hazel on Twitter.



What is faulty in this demonstration that 2 = 1? I asked Gemini via this prompt:
There is a flaw in the logic of the Mathematics on this uploaded file. Can you ascertain what it is? On the surface the differentiation seems logical enough.

The response was quite well explained.

Of course. The flaw in the mathematical logic lies in the incorrect application of differentiation to a sum with a variable number of terms. Here’s a breakdown of the error: 
\( \textbf{The Flaw Explained}\) 
The core mistake happens when moving from the second to the third line of the "proof." 
\( \textbf{The Setup}\): 
The proof starts by defining \(x^2\) as the sum of \(x\) added to itself \(x\) times: $$x^2 = \underbrace{x + x + \dots + x}_{x \text{ times}}$$ This definition itself is only truly valid for integer values of \(x\). 2.

\( \textbf{The Incorrect Differentiation}\): 
The next step applies the derivative with respect to \(x\) to both sides: $$\frac{d}{dx}x^2 = \frac{d}{dx}\left(\underbrace{x + x + \dots + x}_{x \text{ times}}\right)$$ The left side correctly becomes \(2x\). However, the right side is differentiated incorrectly. The proof mistakenly treats the number of terms in the sum as a constant. The rule for the derivative of a sum, \(\frac{d}{dx}\sum f_i = \sum \frac{d}{dx}f_i\), only works when the number of terms is constant. In this case, the number of terms is \(x\), the very variable you are differentiating with respect to. You cannot simply differentiate each term individually and add them up while ignoring that the number of terms is also changing.

\( \textbf{Correct Approach}\)
To correctly differentiate the expression on the right, you must use the product rule, because it's effectively a product of two functions of \(x\): the value of each term (\(x\)) and the number of terms (\(x\)). Let the function be \(f(x) = x \cdot x\). Using the product rule \((uv)' = u'v + uv'\): $$ \begin{align*} \frac{d}{dx}(x \cdot x) &= \left(\frac{d}{dx}x\right) \cdot x + x \cdot \left(\frac{d}{dx}x\right) \\ &= (1 \cdot x) + (x \cdot 1) \\ &= x + x = 2x \end{align*} $$ This correct differentiation results in \(2x = 2x\), which is a valid identity and does not lead to the false conclusion that \(2=1\). In short, the proof is flawed because it misapplies the rules of differentiation by treating a variable number of terms as a constant.

Monday, 12 October 2020

Subfactorials, Semifactorials and Others

I've written about subfactorials before in a post titled Derangements on Sunday, 13th January 2019 where I explained that:

There are formulae and examples of subfactorials (derangements) aplenty there, so in this post I'm going to focus on what rekindled my interest. It was a YouTube video that I'll link to later and the problem posed was to connect the 3's shown in Figure 1 by mathematical operations so the LHS = RHS.


Figure 1

It wasn't made clear what constituted mathematical operations. Certainly the basic arithmetical operations of addition, subtraction, multiplication, division and exponentiation are sufficient, together with brackets, to balance most of the equations in Figure 1. For example:
  • \( (3-3) \times 3 =0\)
  • \(3^{3-3} = 1 \)
  • \(3+3-3=3 \)
  • \( \frac{3}{3}+3=4\)
  • \(3 \times 3 - 3=6 \)
  • \( 3 + 3 + 3 =9 \)
However, for 5, 7 and 8, the factorial is required as shown in Figure 2 where some alternative solutions for the numbers 0, 1, 2, 3, 4, 6 and 9 are shown:


Figure 2

The final problem of balancing the three 3's with 10 does not yield even to the factorial. It's here that the subfactorial is required. Firstly, let's list the subfactorials, up to ten using SageMathCell (permalink) as shown in Figure 3.

Figure 3

It can be seen that subfactorial 3, which we'll write as !3, is equal to 2 and that's what we need to balance the equation. Specifically:$$3! + !3 +!3=6+2+2=10$$If other mathematical operations such as log, square root and differentiation are allowed, then some other solutions are possible, as shown in Figure 4.


Figure 4

Clearly, the subfactorial offers the simplest solution. Here is the video from which the above screenshots were taken:


So much for subfactorials. What are semifactorials? Well, the semifactorial or double factorial of a number \(n\), denoted by \(n!! \) is the product of all the integers from \(1\) up to \(n\) that have the same parity (odd or even) as \(n\). Thus \(5!! = 5 \times 3 \times 1 \) and \( 4!! = 4 \times 2 \). The factorial function iterated twice should be written as \((5!)! = 6.689503 \times 10^{198}\), a very large number. However, the Google Calculator will return this same result when 5!! is entered and thus does not recognise the semifactorial.

The nomenclature associated with factorials can be quite confusing. For example, when the double factorial or semifactorial is odd, it's sometimes called the odd factorial. Thus the odd factorial of 5 is 5 x 3. To confuse matters even more, there's the falling factorial and the rising factorial and this pair goes by a variety of names as well. The former can be referred to as the descending factorial, the falling sequential product, or the lower factorial while the latter can be referred to as the Pochhammer function, the Pochhammer polynomial, the ascending factorial, the rising sequential product, or the upper factorial. 

Again, there are different ways of representing the falling and rising factorials. The respective different representations and definitions are shown below:$$(x)_n = x^{\underline{n}} = x(x-1)(x-2)\cdots(x-n+1) = \prod_{k=1}^n(x-k+1) = \prod_{k=0}^{n-1}(x-k)$$ $$x^{(n)} = x^{\overline{n}} = x(x+1)(x+2)\cdots(x+n-1) = \prod_{k=1}^n(x+k-1) = \prod_{k=0}^{n-1}(x+k)$$Clearly, there's some need for standardisation in the world of factorials. Anyway, let's apply these different sorts of factorials to the number 5, just to highlight the differences:
  • factorial \(5\) is represented as \(5! =120\)
  • factorial \(5\) iterated twice is represented as \((5!)! = 6.689503 \times 10^{198}\)
  • double factorial \(5\) is represented as \(5!! = 5 \times 3 \times 1 = 15 \)
  • \( 5^{\underline{3}}\) would be a falling factorial, equal to \(5 \times 4 \times 3 = 60\)
  • \( 5^{\overline{3}}\) would be a rising factorial, equal to \(5 \times 6 \times 7 = 210\)
Returning to the 3 3 3 = 10 problem, the rising factorial can be used to provide another solution, namely:$$\frac{3^{\overline{3}}}{3!}=\frac{3 \times 4 \times 5}{3 \times 2 \times 1}=\frac{60}{6}=10$$