Let the original cost price be $C$.
Step 1: Selling price when the profit is 40%
\[SP_1 = C + 0.40C = 1.40C\]
Step 2: New cost price and selling price when the profit is 50%
The new cost price is reduced by 40% and Rs. 5. Therefore, the new cost price ($C_{\text{new}}$) is:
\[C_{\text{new}} = 0.60C - 5\]
The selling price when the profit is 50% is:
\[SP_2 = C_{\text{new}} + 0.50C_{\text{new}} = 1.50C_{\text{new}}\]
Step 3: Equating the selling prices
Since the selling price remains the same for both situations, we can equate the two selling prices:
\[1.40C = 1.50(0.60C - 5)\]
Step 4: Solve the equation
Expand both sides:
\[1.40C = 1.50 \times 0.60C - 1.50 \times 5\]
\[1.40C = 0.90C - 7.5\]
Move all terms involving $C$ to one side:
\[1.40C - 0.90C = -7.5\]
\[0.50C = -7.5\]
Solving for $C$:
\[C = \frac{-7.5}{0.50} = 15\]