# Issue with the output of pure functions

I am getting the operator & in outputs of pure functions. e.g. with the following code

transl[t0_] := Function[{f, t}, f[t + t0]];

dt = Function[{f}, f'];

PnUnMinusPnM1UnM1 :=
Function[{op, t0, t, a, n, p1, p2, pn, u1, u2, un}, op[1] + a transl[t0][op[p1], t] + a^2 (transl[t0][op[p2], t])];

PnUnMinusPnM1UnM1[dt, t0, t, a, n, p1, p2, pn, u1, u2, un]


I am getting the output

$$(0\&)+a^2\ \text{p2}'(t+\text{t0})+a\ \text{p1}'(t+\text{t0})$$

Does anyone know what is going wrong? Thanks in advance

• Your syntax is jumbled and it is unclear what you are trying to accomplish. Perhaps you could explain what you are trying to do? Feb 3, 2022 at 17:39
• I am trying to simplifies some heavy formula and I have just cut part of a line of the code. It is some recurrent formula which require some amount of math to be explained. Feb 3, 2022 at 18:29
• try evaluating 1' remembering that dt[f] is just f' and the first term of the body of your function PnUnMinusPmM1UnM1 (not a good name for a function in a SX question by the way!) is op[1] == dt[1] == 1' Feb 3, 2022 at 19:10
• I've put some guidance in the comments section but there are things you can do to help yourself here such as simplifying the function to a minimum size to demonstrate the problem. Trace back the execution of your function to see what is happening (Trace is useful here). Perhaps you realise that 0& is a constant function that always returns 0? I doubt you want to add that to other terms as + is not defined out of the box for functions. Feb 3, 2022 at 19:14

• Okay, but how could one simplify formula of the form $16 \left((0\&)^2+1\right)^2 \sin ^4\left(\frac{\pi }{m}\right)$? Feb 3, 2022 at 18:25
• The question rather is, why are you differentiating a constant function in this way: Function[f, f'][1]?