0

Another novice problem encountered. I am going to need a cardiology surgery. :(

For a simple example,

a = #1 &;
b = #2 &;
f = a^2 + b^2;
f

results in

(#1 &)^2 + (#2 &)^2

However, my goal is

(#1 )^2 + (#2 )^2

I know it can be done as

f=(#1)^2+(#2)^2

But still, substitution is necessary in my work, which means the step of a and b cant be neglected.

So what do I miss? Thanks:)

Robin_Lyn
  • 355
  • 1
  • 9
  • 5
    This is doable, e.g. f = Evaluate[a[#^2] + b[Null,#2^2]]&, but the fact that things have gotten so messy for something so simple is a sign that you're approaching whatever you want to do in the wrong way. What's wrong with not binding anything to a and b and then using a ReplaceAll or something? – b3m2a1 Aug 01 '17 at 03:03
  • Looks like a duplicate: 142072, do you agree? – Kuba Aug 01 '17 at 05:21

0 Answers0