Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Through[Divide[f1, f2][x]]
Replies: 3   Last Post: May 28, 2013 3:48 AM

 Messages: [ Previous | Next ]
 Bob Hanlon Posts: 906 Registered: 10/29/11
Re: Through[Divide[f1, f2][x]]
Posted: May 28, 2013 3:47 AM

"Sometimes it would be nice to have a "reverse map", that
applied each of a list of functions to a single argument,
instead of a single function to each of a list of arguments."

Use Through

Through[{f1, f2, f3, f4}[x]]

{f1[x], f2[x], f3[x], f4[x]}

or Map

#[x] & /@ {f1, f2, f3, f4}

{f1[x], f2[x], f3[x], f4[x]}

Bob Hanlon

On Sun, May 26, 2013 at 5:06 AM, Ray Koopman <koopman@sfu.ca> wrote:

> Either of these will give you f1[x]/f2[x]:
>
> Divide@@{f1@#,f2@#}&@x
>
> Divide@@(#@x&)/@{f1,f2}
>
> Sometimes it would be nice to have a "reverse map", that
> applied each of a list of functions to a single argument,
> instead of a single function to each of a list of arguments.
>
> ----- Andres Guzman <andres.guzman.fernandez@gmail.com> wrote:

> > \$Version
> > 8.0 for Linux x86 (64-bit) (October 10, 2011)
> >
> > Through[Divide[f1, f2][x]]
> > f1[x] (1/f2)[x]
> >
> > (* When what I want is: Divide[f1[x],f2[x]] . An uncomfortable
> > consequence of the way Mathematica treats division.*)
> >
> > Divide[f1, f2] // FullForm
> > Times[f1, Power[f2, -1]]

>
>

Date Subject Author
5/27/13 Andrzej Kozlowski
5/28/13 Bob Hanlon
5/28/13 Ray Koopman