If I execute

A = {Sin, Cos, Tan}
B = {ArcSin, ArcCos, ArcTan}
#[[1]]@#[[2]]@x & /@ Transpose[{A, B}]

the output is


which is to be expected. However, what I want is

{Sin[ArcSin[x]], Cos[ArcCos[x]], Tan[ArcTan[x]]}

Knowing that HoldForm[Sin[ArcSin[x]]] outputs Sin[ArcSin[x]], I tried

A = {Sin, Cos, Tan}
B = {ArcSin, ArcCos, ArcTan}
HoldForm[#[[1]]@#[[2]]@x] & /@ Transpose[{A, B}]

but this gives me


Much like Zach Braff's morning routine, this output is plagued by too much Hold.

How can I Hold the form of the expression without Holding the evaluation of Part?


3 Answers 3


Instead of Hold[], consider using Inactive[]:

MapThread[Inactive[#1][Inactive[#2][x]] &, {{Sin, Cos, Tan}, {ArcSin, ArcCos, ArcTan}}]

(equivalently, MapThread[Inactivate[#1[#2[x]]] &, {{Sin, Cos, Tan}, {ArcSin, ArcCos, ArcTan}}])

which would look like this on the front end:

inactivated functions

To remove Inactive[]:

  {x, x, x}

In older versions, you can try Defer[] or HoldForm[] instead of Inactive[], e.g.


and to remove the held evaluation,


Several alternatives:

Defer[#@#2@x] & @@@ Transpose[{A, B}] 
HoldForm[#@#2@x] & @@@ Transpose[{A, B}] 
MapThread[Compose[HoldForm@#, HoldForm@#2, x] &, {A, B}]
HoldForm[a[b @ x]] /. Thread[{a, b} -> #] & /@ Transpose[{A, B}] 
With[{a = #[[1]], b = #[[2]]}, HoldForm[a[b@x]]] & /@ Transpose[{A, B}]

all give



Another approach using operator forms (and avoiding slots, e.g., #):

Through @* Thread[HoldForm @* A @* B] @ x



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.