Creating a function that derives the function Log[x]

I want to create a function that derives (Derivada) the function Log[x] for any base.

My code:

Derivada[x_^n_, x_Symbol] /; FreeQ[n, x] := n*x^(n - 1)
Derivada[n_*x_, x_Symbol] /; FreeQ[n, x] := n
Derivada[Log[a_: E, x_], x_Symbol] := 1/(x*Log[a])
Derivada[f_, x_Symbol] /; FreeQ[f, x] := 0
Derivada[Exp[x_], x_Symbol] := Exp[x]
Derivada[a_^x_, x_Symbol] := a^x Log[a]
Derivada[u_Plus, x_Symbol] := Derivada[#, x] & /@ u
Derivada[u_*v_, x_Symbol] := u Derivada[v, x] + v Derivada[u, x]


My problem is to derive Log[x]. The functions works for any base Log[2,x], Log[3,x] except when I use just Log[x].

Doesn't work:

In[64]:= Derivada[Log[x], x]



Works:

In[65]:= Derivada[Log[2, x], x]

Out[65]= 1/(x Log[2])

• Is there a reason for not using D? Commented Aug 30, 2018 at 22:12
• Yes.. I want to create my own function "D". Is just for exercise. Commented Aug 30, 2018 at 22:13

Just add the rule

Derivada[Log[x_], x_Symbol] := 1/x


Since Log[x] has only one argument, it cannot match with the pattern Derivada[Log[a_: E, x_] - even if the first argument is optional:

MatchQ[Log[a_: E, x_], Log[x]]


False