Higher order functions - how should they be defined?

  • Context: Undergrad 
  • Thread starter Thread starter seanos
  • Start date Start date
  • Tags Tags
    Functions Higher order
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
seanos
Messages
1
Reaction score
0
I want to write a function that takes other functions as inputs. Specifically I want to define a function F that takes input 't' (time) and 2 distribution functions, D1 and D2, as inputs (each distribution function itself a function of 't').

For a simple example, if function F is the product of these distribution functions at time t then I could write:

F(t) = D1(t) * D2(t)

So far so good. But now, this is where I get stuck, how do I define another function whose definition includes several F functions each using different distribution functions?

To give an example, let's say I want to define a function G which is the difference between two F functions of different distribution functions. Could I write this:

G(t) = F(t, D1(t), D2(t)) - F(t, D2(t), D3(t)) where F(t, X(t), Y(t)) = X(t) * Y(t)

If not, what is a better way to write this?

Thanks for reading this!
 
Mathematics news on Phys.org