# Simplifying nested pure functions

I have several functions:

A=Function[{u},Piecewise[{{1/Sqrt[2],u==0},{1,u!=0}}]]
Cc=Function[{i,u},A[u]*Cos[((2*i+1)*u*Pi)/16]]
IDCT1=Function[{i,j},1/4*Sum[Sum[Cc[i,u]*Cc[j,v]*Q[u,v]*Y1[u,v], {v,0, 7}],{u, 0, 7}]]
IDCT2=Function[{i,j},1/4*Sum[Sum[Cc[i,u]*Cc[j,v]*Q[u,v]*Y2[u,v], {v,0, 7}],{u, 0, 7}]]


where Q is a matrix

FullSimplify accepts expressions, not functions.

How do I simplify ICDT1[i,j]*ICDT2[i,j] without rewriting everything as expressions?

• FullSimplify[ICDT1[i, j] * ICDT2[i, j]] will already (try to) simplify the resulting expression. Would that not work? – MarcoB Mar 12 '19 at 12:38

IDCT = Function[{i, j}, Evaluate@FullSimplify[IDCT1[i, j]*IDCT2[i, j]]]

• Try replacing FullSimplify with Simplify, Factor, or whatever you need. My point was only to show you how to stay with functions instead of expressions, not how to simplify your specific terms. – Roman Mar 13 '19 at 2:33