# Nested expressions as compositions of functions?

• I
• Stephen Tashi
In summary, the conversation discusses ways to write finite nested expressions as compositions of functions, using examples and techniques such as Horner's technique and functions of two variables. The concept of parameterizing functions and the use of affine linear functions is also mentioned. There is also a discussion about a potential mistake in using composition of functions, which is resolved by introducing an additional operator to increase the powers of x.
Stephen Tashi
TL;DR Summary
How can we express nested expressions as a compositions of functions?
How can we write (finite) nested expressions as compositions of functions?

For example (using Horner's technique), consider:
##P(x) = 3 + 2x + 4x^2 + 6 x^3 = 3 + x(2 + x(4 + x(6) ) )##

The way I see to do it is to use functions of two variables.

##f_3(x,y) = 6##
##f_2(x,y) = 4 + xy##
##f_1(x,y) = 2 + xy##
##f_0(x,y) = 3 + xy##

##P(x) = f_0(x,(f_1(x,f_2(x,f_3(x,x)))))##

It seems unnatural to introduce two variables in order to get a nested expression in one variable, but I see no way around it.

If two variables are necessary, you can still consider functions ##f\times g \, : \,(x,y) \longrightarrow h(f(x),g(y)## but this isn't necessary here. We have only scalar multiples ##M_c## and additional shifts ##A_s##. Every ##f_i## can be written as ##f_i(x)=\left(A_{s_i} \circ M_{c_i} \right)(x) := s_i + c_ix##. Hence we have
$$(f_j \circ f_i)(x)=(A_{s_j}\circ M_{c_j}\circ A_{s_i}\circ M_{c_i})(x)= (A_{s_j}\circ M_{c_j}\circ A_{s_i})(c_ix)=(A_{s_j}\circ M_{c_j})(s_i+c_i x)=(A_{s_j})(c_j(s_i+c_ix)x)=s_j+ (c_j(s_i+c_ix)x)$$
This shows, that you parameterized the functions, not the variable. Of course any ##A_s\circ M_c## can be written as affine linear function ##L(s,c)(x)=s+cx## which gives you one parameter ##(s,c)\in \mathbb{R}\times \mathbb{R}^\times## instead of two.

fresh_42 said:
Every ##f_i## can be written as ##f_i(x)=\left(A_{s_i} \circ M_{c_i} \right)(x) := s_i + c_ix##.

I don't understand what definition you are using for the composition of functions. For example, if ##f_1(x) = 3 + 5x## and ##f_2(x) = 4 + 6x## then ##f_1(f_2(x)) = 4 + 6( 3 + 5x) = 22 + 30x## and I don't get any ##x^2## term.

You're right, what a stupid mistake me made. We would need an additional operator ##R_x\, : \,p(x)\longrightarrow p(x)\cdot x## to increase the powers of ##x## - just as many as there are (ring) operations: addition, scalar multiplication and normal multiplication. We could define ##R_{q(x)}(p(x))=p(x)\cdot q(x)## but that would overload the index.

## What are nested expressions as compositions of functions?

Nested expressions as compositions of functions refer to mathematical expressions in which one function is applied to the output of another function. This creates a "nesting" effect, where one function is inside the other.

## Why are nested expressions useful?

Nested expressions allow for more complex mathematical operations to be performed. They also help to simplify and organize long and complicated expressions.

## What is the order of operations for nested expressions?

The order of operations for nested expressions is the same as for regular mathematical expressions - parentheses first, followed by exponents, multiplication and division, and finally addition and subtraction.

## Can any functions be nested?

Yes, any functions can be nested as long as their outputs and inputs are compatible. For example, a logarithmic function can be nested inside a trigonometric function, but a square root function cannot be nested inside a logarithmic function.

## How can nested expressions be evaluated?

Nested expressions can be evaluated by starting from the innermost function and working outwards. The output of each function becomes the input for the next one until the final output is reached.

• General Math
Replies
3
Views
1K
• General Math
Replies
3
Views
802
• General Math
Replies
5
Views
876
• General Math
Replies
3
Views
2K
• General Math
Replies
2
Views
748
• General Math
Replies
4
Views
958
• General Math
Replies
6
Views
898
• General Math
Replies
3
Views
2K
• High Energy, Nuclear, Particle Physics
Replies
2
Views
1K
• General Math
Replies
1
Views
2K