Search code examples
wolfram-mathematica

how to call a multiple function within a multiple one by mathematica?


I have defined a multiple function before and i want to call it within another multiple function by Mathematica software.

enter image description here


Solution

  • You must decide what is known ahead of time and what is known only when the function h is called. For example, you propose

        f[a_,b_] := a+b*a^2
        g[c_,d_] := (c/d)+d*5
        h[x_,y_] := x[a,b] +y[c,d]
    

    This only makes sens if {a,b,c,d} are known outside of the functions. That may simply be the opposite of what you want. That is, you may want to define h in terms of known functions but unknown parameter values. E.g.,

        f[a_,b_] := a+b*a^2
        g[c_,d_] := (c/d)+d*5
        h[a_,b_,c_,d_] := f[a,b] +g[c,d]
    

    Finally, you may want to define h in terms of unknown functions as well as unknown parameter values. E.g.,

        h[a_,b_,c_,d_,f1_,f2_] := f1[a,b] + f2[c,d]