# Jackson Integral

Following an old post, I have tried to make a function that calculates the Jackson integral of $q$-calculus:

Clear[JacksonIntegral];
JacksonIntegral[f_[x_], q_, b_] := (1 - q) b Sum[q^j f[q^j b], {j, 0, ∞}]


When applied to

A[x_] := x^.25


I have no complaint but no evaluation. More generally, how could I make a new rule in Mathematica?

• I'm positive this one is a duplicate now. Possible duplicate. – march Mar 19 '16 at 23:03
• I removed the first sentence, only because this is certainly not a dumb question. – J. M.'s discontentment Mar 20 '16 at 9:10

Your code should work with a small tweak. You just need to use the name of the function instead and input the name of the function or a pure function:

jacksonIntegral[f_, q_, b_] := (1 - q) b Sum[q^j f[q^j b], {j, 0, ∞}]
a[x_] := x^.25
jacksonIntegral[a, 1/2, 0.1]
(* 0.0485152 *)
jacksonIntegral[#^0.25 &, 1/2, 0.1]
(* 0.0485152 *)


Alternatively,

Clear[jacksonIntegral]
SetAttributes[jacksonIntegral, HoldFirst];
jacksonIntegral[f_[x_], q_, b_] := (1 - q) b Sum[q^j f[x] /. x -> q^j b, {j, 0, \[Infinity]}]
a[x_] := x^.25
jacksonIntegral[a[x], 1/2, 0.1]
(* 0.0485152 *)