This Python program reads values for a, x, and n from the user.
It computes the nth derivative of the exponential function e^{ax} using the recursive relation:
dⁿ/dxⁿ(e^{ax}) = aⁿ × e^{ax}
def recursive_derivative(a: float, x: float, n: int) -> float:
if n == 0:
return pow(2.718281828459045, a * x) # e^ax
return a * recursive_derivative(a, x, n - 1)
# Read inputs from user
a = float(input("Enter value for a: "))
x = float(input("Enter value for x: "))
n = int(input("Enter derivative order n: "))
result = recursive_derivative(a, x, n)
print(f"The {n}th derivative of e^({a}x) is: {result:.6f}")
The 3th derivative of e^(2x) is: 40.171944