Dr. Bryan Carrillo’s The Principles of Calculus Website
  • Home
  • About
  • Course Schedule
    • Math 2 Fall 2025 In-Person Schedule
    • Math 3A Fall 2025 In-Person Schedule
  • Course Content
  • Demonstration Questions

On this page

  • Restriction to Subdomains
    • Restriction of a Function to a Set
    • Example 1
    • Example 2
  • The Algebra of Functions
    • Sum and Product of Functions
    • Example 3
    • Polynomial
    • Example 4
    • Quotient of Functions
    • Example 5
    • Example 6
    • Composite Function
    • Example 7
    • Example 8
    • Example 9
    • Example 10
    • Example 11
    • Example 12
  • Decomposing Functions
    • Example 13
    • Example 14
    • Example 15
    • Example 16
    • Example 17
  • Computing the Range of a Function
    • Range of Function
    • Example 18
    • Example 19
  • Return

Chapter 1.5 Manipulating Function

\[ \definecolor{ucrblue}{rgb}{0.0627,0.3843,0.6039} \definecolor{ucrgold}{rgb}{0.9686,0.6941,0.2824} \definecolor{ucrred}{rgb}{0.8941,0,0.1686} \definecolor{ucrgreen}{rgb}{0.4706,0.7451,0.1255} \definecolor{ucraccent}{rgb}{1.0000,0.9569,0.8392} \DeclareMathOperator*{\LO}{O} \DeclareMathOperator*{\Lo}{o} \DeclareMathOperator*{\Recip}{Recip} \DeclareMathOperator*{\abs}{abs} \DeclareMathOperator{\pow}{pow} \]

The functions we will encounter are very complicated, but the principle of decomposition can help with understanding the functions. In this section, we will cover various ways in which decomposition can help us study a function.

Restriction to Subdomains

First, the function we study may have a natural domain that is not ideal to consider. For example \(f(x)=x^2\) has a natural domain and domain of all real numbers. However, if \(x\) describes time, then this domain doesn’t make physical sense. So, we will talk about restricting a function to a set.

Restriction of a Function to a Set

Take \(f\) to be a function with domain \(\mathcal D(f)\) and let \(A\) be a subset of \(\mathcal D(f)\).

Define the restriction of \(f\) to \(A\), denoted by \(f\big|_A\) (read: ``\(f\) restricted to \(A\)’’), to be the function where

  • the domain of \(f\big|_A\) is \(A\);
  • for each \(x\) in \(A\), \(f\big|_A(x) = f(x).\)

Here is a visual that describes restriction:

Practice sketching restrictions with this next example.

Example 1

Sketch \(f\) and its restriction to

  1. \([0,\infty),\)
  2. \([-2, 0) \cup (1, 3]\),

where \(f\) is the line given by \[f(x) = 2x+1.\]

The function \(f\) is a line. On all of \(\mathbb{R}\) it looks like this:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/formatters.py:343, in BaseFormatter.__call__(self, obj)
    341     pass
    342 else:
--> 343     return printer(obj)
    344 # Finally look for special method names
    345 method = get_real_method(obj, self.print_method)

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/pylabtools.py:187, in retina_figure(fig, base64, **kwargs)
    178 def retina_figure(fig, base64=False, **kwargs):
    179     """format a figure as a pixel-doubled (retina) PNG
    180 
    181     If `base64` is True, return base64-encoded str instead of raw bytes
   (...)
    185         base64 argument
    186     """
--> 187     pngdata = print_figure(fig, fmt="retina", base64=False, **kwargs)
    188     # Make sure that retina_figure acts just like print_figure and returns
    189     # None when the figure is empty.
    190     if pngdata is None:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/pylabtools.py:170, in print_figure(fig, fmt, bbox_inches, base64, **kwargs)
    167     from matplotlib.backend_bases import FigureCanvasBase
    168     FigureCanvasBase(fig)
--> 170 fig.canvas.print_figure(bytes_io, **kw)
    171 data = bytes_io.getvalue()
    172 if fmt == 'svg':

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backend_bases.py:2175, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
   2172     # we do this instead of `self.figure.draw_without_rendering`
   2173     # so that we can inject the orientation
   2174     with getattr(renderer, "_draw_disabled", nullcontext)():
-> 2175         self.figure.draw(renderer)
   2176 if bbox_inches:
   2177     if bbox_inches == "tight":

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/artist.py:95, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
     93 @wraps(draw)
     94 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 95     result = draw(artist, renderer, *args, **kwargs)
     96     if renderer._rasterizing:
     97         renderer.stop_rasterizing()

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/artist.py:72, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
     69     if artist.get_agg_filter() is not None:
     70         renderer.start_filter()
---> 72     return draw(artist, renderer)
     73 finally:
     74     if artist.get_agg_filter() is not None:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/figure.py:3162, in Figure.draw(self, renderer)
   3159             # ValueError can occur when resizing a window.
   3161     self.patch.draw(renderer)
-> 3162     mimage._draw_list_compositing_images(
   3163         renderer, self, artists, self.suppressComposite)
   3165     renderer.close_group('figure')
   3166 finally:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/image.py:132, in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
    130 if not_composite or not has_images:
    131     for a in artists:
--> 132         a.draw(renderer)
    133 else:
    134     # Composite any adjacent images together
    135     image_group = []

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/artist.py:72, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
     69     if artist.get_agg_filter() is not None:
     70         renderer.start_filter()
---> 72     return draw(artist, renderer)
     73 finally:
     74     if artist.get_agg_filter() is not None:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/axes/_base.py:3101, in _AxesBase.draw(self, renderer)
   3098     for spine in self.spines.values():
   3099         artists.remove(spine)
-> 3101 self._update_title_position(renderer)
   3103 if not self.axison:
   3104     for _axis in self._axis_map.values():

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/axes/_base.py:3055, in _AxesBase._update_title_position(self, renderer)
   3053     _log.debug('top of Axes not in the figure, so title not moved')
   3054     return
-> 3055 if title.get_window_extent(renderer).ymin < top:
   3056     _, y = self.transAxes.inverted().transform((0, top))
   3057     title.set_position((x, y))

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/text.py:959, in Text.get_window_extent(self, renderer, dpi)
    954     raise RuntimeError(
    955         "Cannot get window extent of text w/o renderer. You likely "
    956         "want to call 'figure.draw_without_rendering()' first.")
    958 with cbook._setattr_cm(self.figure, dpi=dpi):
--> 959     bbox, info, descent = self._get_layout(self._renderer)
    960     x, y = self.get_unitless_position()
    961     x, y = self.get_transform().transform((x, y))

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/text.py:381, in Text._get_layout(self, renderer)
    379 clean_line, ismath = self._preprocess_math(line)
    380 if clean_line:
--> 381     w, h, d = _get_text_metrics_with_cache(
    382         renderer, clean_line, self._fontproperties,
    383         ismath=ismath, dpi=self.figure.dpi)
    384 else:
    385     w = h = d = 0

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/text.py:69, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
     66 """Call ``renderer.get_text_width_height_descent``, caching the results."""
     67 # Cached based on a copy of fontprop so that later in-place mutations of
     68 # the passed-in argument do not mess up the cache.
---> 69 return _get_text_metrics_with_cache_impl(
     70     weakref.ref(renderer), text, fontprop.copy(), ismath, dpi)

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/text.py:77, in _get_text_metrics_with_cache_impl(renderer_ref, text, fontprop, ismath, dpi)
     73 @functools.lru_cache(4096)
     74 def _get_text_metrics_with_cache_impl(
     75         renderer_ref, text, fontprop, ismath, dpi):
     76     # dpi is unused, but participates in cache invalidation (via the renderer).
---> 77     return renderer_ref().get_text_width_height_descent(text, fontprop, ismath)

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backends/backend_agg.py:212, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
    210 _api.check_in_list(["TeX", True, False], ismath=ismath)
    211 if ismath == "TeX":
--> 212     return super().get_text_width_height_descent(s, prop, ismath)
    214 if ismath:
    215     ox, oy, width, height, descent, font_image = \
    216         self.mathtext_parser.parse(s, self.dpi, prop)

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backend_bases.py:597, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
    593 fontsize = prop.get_size_in_points()
    595 if ismath == 'TeX':
    596     # todo: handle properties
--> 597     return self.get_texmanager().get_text_width_height_descent(
    598         s, fontsize, renderer=self)
    600 dpi = self.points_to_pixels(72)
    601 if ismath:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/texmanager.py:363, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
    361 if tex.strip() == '':
    362     return 0, 0, 0
--> 363 dvifile = cls.make_dvi(tex, fontsize)
    364 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
    365 with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/texmanager.py:295, in TexManager.make_dvi(cls, tex, fontsize)
    293     with TemporaryDirectory(dir=cwd) as tmpdir:
    294         tmppath = Path(tmpdir)
--> 295         cls._run_checked_subprocess(
    296             ["latex", "-interaction=nonstopmode", "--halt-on-error",
    297              f"--output-directory={tmppath.name}",
    298              f"{texfile.name}"], tex, cwd=cwd)
    299         (tmppath / Path(dvifile).name).replace(dvifile)
    300 return dvifile

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
    254     raise RuntimeError(
    255         f'Failed to process string with tex because {command[0]} '
    256         'could not be found') from exc
    257 except subprocess.CalledProcessError as exc:
--> 258     raise RuntimeError(
    259         '{prog} was not able to process the following string:\n'
    260         '{tex!r}\n\n'
    261         'Here is the full command invocation and its output:\n\n'
    262         '{format_command}\n\n'
    263         '{exc}\n\n'.format(
    264             prog=command[0],
    265             format_command=cbook._pformat_subprocess(command),
    266             tex=tex.encode('unicode_escape'),
    267             exc=exc.output.decode('utf-8', 'backslashreplace'))
    268         ) from None
    269 _log.debug(report)
    270 return report

RuntimeError: latex was not able to process the following string:
b'$f(x)=2x+1$ on $\\\\mathbb{R}$'

Here is the full command invocation and its output:

latex -interaction=nonstopmode --halt-on-error --output-directory=tmpoo31uk9o 9fd6daa02178441b653778e53b0683d2.tex

This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./9fd6daa02178441b653778e53b0683d2.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-02-20>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2024/texmf-dist/tex/latex/type1cm/type1cm.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/cm-super/type1ec.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/t1cmr.fd))
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/inputenc.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2024/texmf-dist/tex/generic/iftex/ifvtex.sty
(/usr/local/texlive/2024/texmf-dist/tex/generic/iftex/iftex.sty)))
(/usr/local/texlive/2024/texmf-dist/tex/latex/underscore/underscore.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/firstaid/underscore-ltx.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/textcomp.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
No file 9fd6daa02178441b653778e53b0683d2.aux.
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
! Undefined control sequence.
<recently read> \mathbb 
                        
l.30 {\rmfamily $f(x)=2x+1$ on $\mathbb
                                       {R}$}%
No pages of output.
Transcript written on tmpoo31uk9o/9fd6daa02178441b653778e53b0683d2.log.


<Figure size 960x480 with 1 Axes>

On \([0,\infty)\) it looks like this

On \([-2,0)\cup(1,3]\) it looks like this

Now, let us look at restricting \({\rm pow}_2\).

Example 2

Sketch \(f\) and its restriction to

  1. \([0,\infty)\) and
  2. \([-1, 0] \cup (1, 2]\),

where \(f\) is given by \[f(x) = x^2.\]

The function \(f\) on all of \(\mathbb{R}\) it looks like this:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/formatters.py:343, in BaseFormatter.__call__(self, obj)
    341     pass
    342 else:
--> 343     return printer(obj)
    344 # Finally look for special method names
    345 method = get_real_method(obj, self.print_method)

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/pylabtools.py:187, in retina_figure(fig, base64, **kwargs)
    178 def retina_figure(fig, base64=False, **kwargs):
    179     """format a figure as a pixel-doubled (retina) PNG
    180 
    181     If `base64` is True, return base64-encoded str instead of raw bytes
   (...)
    185         base64 argument
    186     """
--> 187     pngdata = print_figure(fig, fmt="retina", base64=False, **kwargs)
    188     # Make sure that retina_figure acts just like print_figure and returns
    189     # None when the figure is empty.
    190     if pngdata is None:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/pylabtools.py:170, in print_figure(fig, fmt, bbox_inches, base64, **kwargs)
    167     from matplotlib.backend_bases import FigureCanvasBase
    168     FigureCanvasBase(fig)
--> 170 fig.canvas.print_figure(bytes_io, **kw)
    171 data = bytes_io.getvalue()
    172 if fmt == 'svg':

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backend_bases.py:2175, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
   2172     # we do this instead of `self.figure.draw_without_rendering`
   2173     # so that we can inject the orientation
   2174     with getattr(renderer, "_draw_disabled", nullcontext)():
-> 2175         self.figure.draw(renderer)
   2176 if bbox_inches:
   2177     if bbox_inches == "tight":

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/artist.py:95, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
     93 @wraps(draw)
     94 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 95     result = draw(artist, renderer, *args, **kwargs)
     96     if renderer._rasterizing:
     97         renderer.stop_rasterizing()

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/artist.py:72, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
     69     if artist.get_agg_filter() is not None:
     70         renderer.start_filter()
---> 72     return draw(artist, renderer)
     73 finally:
     74     if artist.get_agg_filter() is not None:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/figure.py:3162, in Figure.draw(self, renderer)
   3159             # ValueError can occur when resizing a window.
   3161     self.patch.draw(renderer)
-> 3162     mimage._draw_list_compositing_images(
   3163         renderer, self, artists, self.suppressComposite)
   3165     renderer.close_group('figure')
   3166 finally:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/image.py:132, in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
    130 if not_composite or not has_images:
    131     for a in artists:
--> 132         a.draw(renderer)
    133 else:
    134     # Composite any adjacent images together
    135     image_group = []

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/artist.py:72, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
     69     if artist.get_agg_filter() is not None:
     70         renderer.start_filter()
---> 72     return draw(artist, renderer)
     73 finally:
     74     if artist.get_agg_filter() is not None:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/axes/_base.py:3101, in _AxesBase.draw(self, renderer)
   3098     for spine in self.spines.values():
   3099         artists.remove(spine)
-> 3101 self._update_title_position(renderer)
   3103 if not self.axison:
   3104     for _axis in self._axis_map.values():

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/axes/_base.py:3055, in _AxesBase._update_title_position(self, renderer)
   3053     _log.debug('top of Axes not in the figure, so title not moved')
   3054     return
-> 3055 if title.get_window_extent(renderer).ymin < top:
   3056     _, y = self.transAxes.inverted().transform((0, top))
   3057     title.set_position((x, y))

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/text.py:959, in Text.get_window_extent(self, renderer, dpi)
    954     raise RuntimeError(
    955         "Cannot get window extent of text w/o renderer. You likely "
    956         "want to call 'figure.draw_without_rendering()' first.")
    958 with cbook._setattr_cm(self.figure, dpi=dpi):
--> 959     bbox, info, descent = self._get_layout(self._renderer)
    960     x, y = self.get_unitless_position()
    961     x, y = self.get_transform().transform((x, y))

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/text.py:381, in Text._get_layout(self, renderer)
    379 clean_line, ismath = self._preprocess_math(line)
    380 if clean_line:
--> 381     w, h, d = _get_text_metrics_with_cache(
    382         renderer, clean_line, self._fontproperties,
    383         ismath=ismath, dpi=self.figure.dpi)
    384 else:
    385     w = h = d = 0

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/text.py:69, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
     66 """Call ``renderer.get_text_width_height_descent``, caching the results."""
     67 # Cached based on a copy of fontprop so that later in-place mutations of
     68 # the passed-in argument do not mess up the cache.
---> 69 return _get_text_metrics_with_cache_impl(
     70     weakref.ref(renderer), text, fontprop.copy(), ismath, dpi)

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/text.py:77, in _get_text_metrics_with_cache_impl(renderer_ref, text, fontprop, ismath, dpi)
     73 @functools.lru_cache(4096)
     74 def _get_text_metrics_with_cache_impl(
     75         renderer_ref, text, fontprop, ismath, dpi):
     76     # dpi is unused, but participates in cache invalidation (via the renderer).
---> 77     return renderer_ref().get_text_width_height_descent(text, fontprop, ismath)

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backends/backend_agg.py:212, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
    210 _api.check_in_list(["TeX", True, False], ismath=ismath)
    211 if ismath == "TeX":
--> 212     return super().get_text_width_height_descent(s, prop, ismath)
    214 if ismath:
    215     ox, oy, width, height, descent, font_image = \
    216         self.mathtext_parser.parse(s, self.dpi, prop)

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backend_bases.py:597, in RendererBase.get_text_width_height_descent(self, s, prop, ismath)
    593 fontsize = prop.get_size_in_points()
    595 if ismath == 'TeX':
    596     # todo: handle properties
--> 597     return self.get_texmanager().get_text_width_height_descent(
    598         s, fontsize, renderer=self)
    600 dpi = self.points_to_pixels(72)
    601 if ismath:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/texmanager.py:363, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
    361 if tex.strip() == '':
    362     return 0, 0, 0
--> 363 dvifile = cls.make_dvi(tex, fontsize)
    364 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
    365 with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/texmanager.py:295, in TexManager.make_dvi(cls, tex, fontsize)
    293     with TemporaryDirectory(dir=cwd) as tmpdir:
    294         tmppath = Path(tmpdir)
--> 295         cls._run_checked_subprocess(
    296             ["latex", "-interaction=nonstopmode", "--halt-on-error",
    297              f"--output-directory={tmppath.name}",
    298              f"{texfile.name}"], tex, cwd=cwd)
    299         (tmppath / Path(dvifile).name).replace(dvifile)
    300 return dvifile

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/texmanager.py:258, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
    254     raise RuntimeError(
    255         f'Failed to process string with tex because {command[0]} '
    256         'could not be found') from exc
    257 except subprocess.CalledProcessError as exc:
--> 258     raise RuntimeError(
    259         '{prog} was not able to process the following string:\n'
    260         '{tex!r}\n\n'
    261         'Here is the full command invocation and its output:\n\n'
    262         '{format_command}\n\n'
    263         '{exc}\n\n'.format(
    264             prog=command[0],
    265             format_command=cbook._pformat_subprocess(command),
    266             tex=tex.encode('unicode_escape'),
    267             exc=exc.output.decode('utf-8', 'backslashreplace'))
    268         ) from None
    269 _log.debug(report)
    270 return report

RuntimeError: latex was not able to process the following string:
b'$f(x)=x^2$ on $\\\\mathbb{R}$'

Here is the full command invocation and its output:

latex -interaction=nonstopmode --halt-on-error --output-directory=tmppqry6zdo 9337f0352806c936fe36fe3ac7000ac3.tex

This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./9337f0352806c936fe36fe3ac7000ac3.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-02-20>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2024/texmf-dist/tex/latex/type1cm/type1cm.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/cm-super/type1ec.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/t1cmr.fd))
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/inputenc.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2024/texmf-dist/tex/generic/iftex/ifvtex.sty
(/usr/local/texlive/2024/texmf-dist/tex/generic/iftex/iftex.sty)))
(/usr/local/texlive/2024/texmf-dist/tex/latex/underscore/underscore.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/firstaid/underscore-ltx.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/textcomp.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
No file 9337f0352806c936fe36fe3ac7000ac3.aux.
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
! Undefined control sequence.
<recently read> \mathbb 
                        
l.30 {\rmfamily $f(x)=x^2$ on $\mathbb
                                      {R}$}%
No pages of output.
Transcript written on tmppqry6zdo/9337f0352806c936fe36fe3ac7000ac3.log.


<Figure size 960x480 with 1 Axes>

The function \(f\) on all of \([0,\infty)\) it looks like this:

The function \(f\) on all of \([0,\infty)\) it looks like this:

The Algebra of Functions

Just as we can create new sets by using set operations, we can create new function by using certain operations.

First, functions can be created by summing up two functions or multiplying two functions.

Sum and Product of Functions

Assumption: \(\mathcal D(f) \cap\mathcal D(g)\) is not empty.

Define the functions \(f+g\) and \(f\cdot g\) by \[(f+g)(x) = f(x) + g(x) \quad {\rm and}\quad (f\cdot g)(x) = f(x) \cdot g(x).\]

These new functions are defined only on the smaller domain \(D\) with \[D = \mathcal D(f)\cap \mathcal D(g).\]

Do you see why the domain of these new functions must be \(\mathcal{D}(f)\cap \mathcal{D}(g)?\)

Use the next example to make sense of that question.

Example 3

Take \(f\) to be the function that is defined for all \(x\) in \((-3, 5]\) by \[f(x) = x^2.\] Take \(g\) to be the function that is defined for all \(x\) in \([-1, 7)\) by \[g(x) = x-3.\] Can you evaluate \(f+g\) and \(f\cdot g\) at the points \(-2\), \(-1\), and \(3\)? If so, evaluate the functions at these points.

Before evaluating, first figure out the common domain.

The domain of \(f\), \(\mathcal{D}(f)\) is \((-3,5]\).

The domain of \(g\), \(\mathcal{D}(g)\) is \([-1,7)\).

The domain of \(f+g\) and \(f\cdot g\) is \[D=\mathcal{D}(f)\cap\mathcal{D}(g)=[-1,5].\]

The functions \(f+g\) and \(f\cdot g\) are both defined at \(-1\) and \(3\) because it is in the interval \(D.\) Here are the values of \(f+g\) and \(f\cdot g\):

  • \[(f+g)(-1)=f(-1)+g(-1)=1+(-4)=-3,\]
  • \[(f+g)(3)=f(3)+g(3)=9+0=9,\]
  • \[(f\cdot g)(-1)=f(-1)\cdot g(-1)=1\cdot(-4)=-4,\]
  • \[(f\cdot g)(3)=f(3)\cdot g(3)=9\cdot 0=0.\]

The functions \(f+g\) and \(f\cdot g\) are not defined at \(-2\) because it is not in the common domain \[D.\]

One example of a function that is sum of certain kinds of functions is a polynomial.

Polynomial

A polynomial is a finite sum of monomials. Assume \(k\) and \(n\) are natural numbers.

A term of the form \(a_kx^k\) is called a degree \(k\) term and the number \(a_k\) is the coefficient of the degree \(k\) term.

The largest \(n\) so that \(a_n\) is not zero is called the degree of \(f\) and is denoted by \(\deg(f)\). The number \(a_n\) is called the leading coefficient and the term \(a_nx^n\) is the leading term.

Non-zero constant polynomials are called degree zero polynomials.

Use the next example to identify these key features.

Example 4

Take \(f\) to be the function that is defined by \[f(x) = 4x^3 + 3x^2 + x - 6.\] Evaluate \(f\) at \(-2\), \(0\), and \(1\). What is the degree of \(f\)? What is the coefficient of the degree 2 term?

The evaluation of \(f\) at \(-2\), \(0\), and \(1\) is given below:

  • \[f(-2)=4\cdot(-2)^3+3\cdot(-2)^2+(-2)-6=-28\]
  • \[f(0)=4\cdot(0)^3+3\cdot(0)^2+(0)-6=-6\]
  • \[f(1)=4\cdot(1)^3+3\cdot(1)^2+(1)-6=2\]
  • \[(f\cdot g)(3)=f(3)\cdot g(3)=9\cdot 0=0.\]

The degree of \(f\) is \(3\) and the coefficient of the degree 2 term is \(3\).

Besides summing and multiplying, dividing two functions also produces a new function.

Quotient of Functions

Suppose that \(\mathcal D(f)\cap \{x\in \mathcal D(g)\colon g(x) \ne 0\}\) is not empty.

For each \(x\) in \(\mathcal D(f)\cap \{x\in \mathcal D(g)\colon g(x) \ne 0\}\), define the function \(\frac{f}{g}\) by \[\left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)}.\]

Here are two examples.

Example 5

Determine \(\mathcal D\!\left(\frac{f}{g}\right)\), where \(f\) and \(g\) are the functions given by \[f(x) = 2x+1 \quad {\rm and} \quad g(x) = x-5.\]

Find the domain of the numerator, \(f\) and the denominator, \(g\).

In this example, both \(f\) and \(g\) are linear functions, so

  • \[\mathcal{D}(f)=(-\infty,\infty)\]
  • \[\mathcal{D}(g)=(-\infty,\infty)\]

Determine the zero set of the denominator \(g\): \[g(x)=0\] whenever \[x-5=0.\] Thus \(x=5\) is the value we exclude from the domain of \(g\):

\[\{x\in \mathcal D(g)\colon g(x) \ne 0\}=(-\infty,5)\cup(5,\infty),\]

Thus the domain \(\mathcal D\!\left(\frac{f}{g}\right)\) is \[\mathcal D(f)\cap \{x\in \mathcal D(g)\colon g(x) \ne 0\}=(-\infty,\infty)\cap\left[(-\infty,5)\cup(5,\infty)\right]=(-\infty,5)\cup(5,\infty).\]

Try this next example as well.

Example 6

Determine \(\mathcal D\!\left(\frac{f}{g}\right)\), where \(f\) and \(g\) are the functions given by \[f(x) = x \quad {\rm and} \quad g(x) = x.\]

Find the domain of the numerator, \(f\) and the denominator, \(g\).

In this example, both \(f\) and \(g\) are linear functions, so

  • \[\mathcal{D}(f)=(-\infty,\infty)\]
  • \[\mathcal{D}(g)=(-\infty,\infty)\]

Determine the zero set of the denominator \(g\): \[g(x)=0\] whenever \[x=0.\] Thus \(x=0\) is the value we exclude from the domain of \(g\):

\[\{x\in \mathcal D(g)\colon g(x) \ne 0\}=(-\infty,0)\cup(0,\infty),\]

Thus the domain \(\mathcal D\!\left(\frac{f}{g}\right)\) is \[\mathcal D(f)\cap \{x\in \mathcal D(g)\colon g(x) \ne 0\}=(-\infty,\infty)\cap\left[(-\infty,0)\cup(0,\infty)\right]=(-\infty,0)\cup(0,\infty).\]

Another operation that produces a new function is called composition.

Composite Function

Take \(f\) and \(g\) to be real valued functions.

For every \(x\) in \(\mathcal D(g)\) such that \(g(x)\) is in \(\mathcal D(f)\), define the function \(f\circ g\) (read: ``\(f\) composed with \(g\)’’) by \[(f\circ g)(x) = f(g(x)).\]

The function \(f\circ g\) is a composite function.

The way this operation works is that instead of evaluating the function \(f\) at \(x\), evaluate the function \(f\) at \(g(x).\)

To better understand this, here is an example of a composition.

Example 7

Find a formula for the function \(f\circ g\) and for the function \(g\circ f\), where \(f\) and \(g\) are given by \[f(x) = x^2 + 1 \quad {\rm and}\quad g(x) = 2x+3.\]

The function \(f(x)=x^2+1\) can be broken up as \(f(\star)=(\star)^2+1\). In words, square the input then add one.

The function \(g(x)=2x+1\) can be broken up as \(f(\star)=2(\star)+3\). In words, multiply the input by 2 then add three.

The function \(f\circ g\) is defined as \((f\circ g)(x)=f(g(x)).\) Therefore

\[\begin{align*} (f\circ g)(x)&=f(g(x))\\ &=(g(x))^2+1\\ &=(2x+3)^2+1&&\text{ recall } \star^2=\star\cdot\star \text{ so }(2x+3)^2=(2x+3)(2x+3)\\ &=(4x^2+12+9)+1\\ &=4x^2+12x+10 \end{align*}.\]

The function \(g\circ f\) is defined as \((g\circ f)(x)=g(f(x)).\) Therefore

\[\begin{align*} (g\circ f)(x)&=g(f(x))\\ &=2\cdot(f(x))+3\\ &=2\cdot(x^2+1)+3\\ &=2x^2+2+3\\ &=2x^2+5 \end{align*}.\]

We will use the principle of decomposition to determine the domain of a function.

Example 8

Take \(f\) and \(g\) to be the functions with \[\mathcal D(f) = (-4, 12]\quad {\rm and} \quad \mathcal D(g) = (-\infty, 10).\] If \(\{-5, 3, 7\}\) is the zero set of \(g\), then what are the domains of \(f+g\), \(f\cdot g\), and \(\frac{f}{g}\)?

The intersection \(\mathcal D(f)\cap \mathcal D(g)\) is \((-4,10)\).

Therefore, the domain of \(f+g\) and \(f\cdot g\) is \((-4,10).\)

The domain of \(\frac{f}{g}\) is \(\mathcal{D}(f)\cap\{x\in \mathcal D(g)\colon g(x) \ne 0\}\). The set \(\{x\in \mathcal D(g)\colon g(x) \ne 0\}\) is the domain of \(g\) with the zero set of \(g\) removed. So \[\{x\in \mathcal D(g)\colon g(x) \ne 0\}=(-\infty,10)\setminus\{-5,3,7\}=(-\infty,-5)\cup(-5,3)\cup(3,7)\cup(7,10).\]

Therefore

\[\mathcal{D}(f)\cap\{x\in \mathcal D(g)\colon g(x) \ne 0\}=(-4,12]\cap\left((-\infty,-5)\cup(-5,3)\cup(3,7)\cup(7,10)\right)=(-4,3)\cup(3,7)\cup(7,10).\]

In this next example, practice determining the domain of functions with given formulas.

Example 9

Take \(f\) and \(g\) to be given by \[f(x) = \sqrt{x -4}\quad \text{and}\quad g(x) = \sqrt{9-x}.\] What are the domains of the two functions, their product, and the quotient \(\frac{f}{g}\)?

The function \(\mathrm{pow}_{1/2}(\star)=\sqrt{\star}\) is defined as long as \(\star\geq 0\).

The function \(f(x)=\sqrt{x-4}\) is defined as long as \(x-4\geq 0\) which is equivalent to \(x\geq 4\).

So \(\mathcal D(f)=[4,\infty)\).

The function \(g(x)=\sqrt{9-x}\) is defined as long as \(9-x\geq 0\) which is equivalent to \(9\geq x\) or \(x\leq 9\).

So \(\mathcal D(g)=(-\infty,9]\).

Now calculate \(\mathcal D(f)\cap \mathcal{D}(g).\) The intersection is \([4,9]\) and thus the domain of \((f\cdot g)\) is \([4,9]\).

To calculate \(\mathcal D\left(\frac{f}{g}\right)=\mathcal{D}(f)\cap\{x\in \mathcal D(g)\colon g(x) \ne 0\}\), find \(\{x\in \mathcal D(g)\colon g(x) \ne 0\}\), which is the domain of the denominator \(g\) (\((-\infty,9]\)) with the zero set of \(g\) removed. The function \(g(x)=\sqrt{9-x}\) is zero when \(9-x=0\); the zero set is \(\{9\}\). Remove \(9\) from the set \((-\infty,9].\)

Thus \(\{x\in \mathcal D(g)\colon g(x) \ne 0\}=(-\infty,9).\)

Our final answer for \(\mathcal D\left(\frac{f}{g}\right)\) is \(\mathcal D(f)=[4,\infty)\) intersect \(\{x\in \mathcal D(g)\colon g(x) \ne 0\}=(-\infty,9)\), which simplifies to \([4,9).\)

In this example, practice finding the domain of a composite function.

Example 10

Suppose that \(f\) and \(g\) are given by \[f(x) = \frac{1}{x} \quad \text{and}\quad g(x) = \sqrt{x - 4}.\]

  1. What is the domain of \(f\circ g\)?

  2. What is the domain of \(g\circ f\)?

  3. Does \(f\circ g = g\circ f\)?

Identify the domain of \(f\) and \(g\).

The domain of \(f(x)=\frac{1}{x}\) is \((-\infty,0)\cup(0,\infty).\)

The domain of \(g(x)=\sqrt{x-4}\) is \([4,\infty).\)

  1. To find domain of \(f\circ g\), first find domain of \(g\). It is \([4,\infty).\)

    The domain of \(f\circ g\) is all \(x\) that are in domain of \(g\) and for which the output \(g(x)\) is in the domain of \(\mathcal{D}(f).\)

    In this example, the output \(g(x)=\sqrt{x-4}\) must be a real number in \(\mathcal{D}(f)=(-\infty,0)\cup(0,\infty).\) Thus \(\sqrt{x-4}\) cannot equal \(0\). This happens when \(x=4\).

    So the answer is \([4,\infty)\) remove \(x=4.\)

    Thus \(\mathcal{D}(f\circ g)=(4,\infty)\)

  2. To find domain of \(g\circ f\), first find domain of \(f\). It is \((-\infty,0)\cup(0,\infty)\)

    The domain of \(g\circ f\) is all \(x\) that are in domain of \(f\) and for which the output \(f(x)\) is in the domain of \(\mathcal{D}(g).\)

    In this example, the output \(f(x)=\frac{1}{x}\) must be a real number in \(\mathcal{D}(g)=[4,\infty).\) Thus \(\frac{1}{x}\) must be greater than or equal to \(4\). This happens when \(x\) is in the interval \((0,\frac{1}{4}]\).

    So the answer is \((-\infty,0)\cup(0,\infty)\) intersect \((0,\frac{1}{4}]\).

    Thus \(\mathcal{D}(g\circ f)=(0,\frac{1}{4}]\)

  3. The composite functions \((f\circ g)(x)=f(g(x))=\frac{1}{g(x)}\) and \((g\circ f)(x)=g(f(x))=\sqrt{f(x)-4}=\sqrt{\frac{1}{x}-4}\) are not the same.

Complicated functions can be created by using some combination of addition, multiplication, division, and the composition operation on elementary functions.

The arithmetical properties of addition and multiplication give similar properties for the associated operations, for example, \(+\) and \(\cdot\) are associative, commutative, and the operations distribute.

Be careful, however when dealing with composition. Composition is associative, but does not in general commute or distribute over addition or multiplication.

Understand this warning by carefully answering this next example.

Example 11

Take \(f\), \(g\), and \(h\) to be the functions given by \[f(x) = \frac{1}{x},\quad g(x) = 3x,\quad {\rm and}\quad h(x) = x^2.\] Calculate \(f\circ(g+h)\), \((f\circ g) + (f\circ h)\), \((g+h)\circ f\), and \((g\circ f) + (h\circ f)\).

The function \(f(x)=\frac{1}{x}\) can be broken up as \(f(\star)=\frac{1}{\star}\). In words, it is one divided by the input.

The function \(g(x)=3x\) can be broken up as \(f(\star)=3(\star)\). In words, multiply the input by 3.

The function \(h(x)=x^2\) can be broken up as \(f(\star)=(\star)^2\). In words, multiply the input by 3.

The function \(g+h\) is defined as \((g+h)(x)=3x+x^2.\)

Since \(f(\star)=\frac{1}{\star}\), we get

\[\begin{align*} f\circ(g+h)(x)&=\frac{1}{(g+h)(x)}\\ &=\frac{1}{3x+x^2}. \end{align*}\]

The function \(f\circ g\) is defined as \((f\circ g)(x)=\frac{1}{3x}.\)

The function \(f\circ h\) is defined as \((f\circ h)(x)=\frac{1}{x^2}.\)

Therefore

\[\begin{align*} (f\circ g)(x)+(f\circ h)(x)&=f(g(x))+f(h(x))\\ &=\frac{1}{3x}+\frac{1}{x^2}\\ &=\frac{x+3}{3x^2}. \end{align*}\]

For \((g+h)\circ f\), and \((g\circ f) + (h\circ f)\). we have

\[\begin{align*} (g+h)(x)\circ f(x)&=3(f(x))+(f(x))^2\\ &=3\frac{1}{x}+\left(\frac{1}{x}\right)^2\\ &=\frac{3}{x}+\frac{1}{x^2}. \end{align*}\]

\[\begin{align*} (g\circ f)(x)+(h\circ f)(x)&=3(f(x))+(f(x))^2\\ &=3\frac{1}{x}+\left(\frac{1}{x}\right)^2\\ &=\frac{3}{x}+\frac{1}{x^2}. \end{align*}\]

We will use the power of decomposition to handle the following problem.

Example 12

Take \(a\), \(b\), \(c\), \(d\), and \(e\) to be the functions given by \[a(x) = x,\; b(x) = x^2,\; c(x) = x+1,\; d(x) = 5x,\; e(x) = \sqrt{x}.\] For each \(x\) where the function \(f\) is defined, calculate \(f(x)\), where \[f = \frac{a\cdot e}{c\circ b\circ c} + e\circ e\circ(3a + c\circ d\circ b).\]

Use decomposition to split \(f\): \[f(x)=\text{part}_1(x)+\text{part}_2(x).\]

For \(\text{part}_1(x)\)

\[\text{part}_1=\frac{a\cdot e}{c\circ b\circ c}=\frac{\text{Part A}}{\text{Part B}}.\]

For \(\text{Part A}\) and \(\text{Part B}\)

\[\text{Part A}(x)= a(x)\cdot e(x)=x \sqrt{x}\],

\[\begin{align}\text{Part B}(x)&= (c\circ b\circ c)(x)\\ &=c\circ \left[b(c(x))\right]\\ &=c[(x+1)^2]\\ &=c[x^2+2x+1]\\ &=(x^2+2x+1)+1\\ &=x^2+2x+2.\\ \end{align}\]

Thus

\[\begin{align} \text{part}_1(x)=&\frac{(a\cdot e)(x)}{(c\circ b\circ c)(x)}\\ &=\frac{\text{Part A}(x)}{\text{Part B}(x)}\\ &=\frac{x\sqrt{x}}{x^2+2x+2}. \end{align}\]

For \(\text{part}_2(x)\)

\[\text{part}_2=(e\circ e)\circ(3a+c\circ d\circ b)=\text{Part C}\circ\text{Part D}.\]

For \(\text{Part C}\) and \(\text{Part D}\)

\[\text{Part C}(x)=(e\circ e)(x)=e(\sqrt{x})=\sqrt{\sqrt{x}}\],

\[\begin{align}\text{Part D}(x)&= 3a(x)+c\circ [d(b(x))]\\ &=3x+c[5(x)^2]\\ &=3x+[5x^2]+1\\ &=5x^2+3x+1 \end{align}\]

Thus

\[\begin{align} \text{part}_2(x)=&\text{Part C}\circ\text{Part D}(x)\\ &=\sqrt{\sqrt{\text{Part D}(x)}}\\ &=\sqrt{\sqrt{5x^2+3x+1}}. \end{align}\]

Altogether,

\[f(x)=\frac{x\sqrt{x}}{x^2+2x+2}+\sqrt{\sqrt{5x^2+3x+1}}.\]

Decomposing Functions

A function \(h\) may be built as sums, products, and composites of other simpler functions.

  • Sum: \(h(x) = f(x) + g(x)\)
  • Product: \(h(x) = f(x)g(x)\)
  • Quotient: \(h(x) = \dfrac{f(x)}{g(x)}\)
  • Composite: \(h(x) = f(g(x))\).

Understanding the structural components of a function means that we understand how a function is built from other functions.

First, let’s look at a sum.

Example 13

Write \(f\) as a sum of functions, where \[f(x) = x^2 - 3x^5.\]

Here is one way to write \(f\) as a sum.

Take \(g(x)=x^2\) and \(h(x)=-3x^2\). Then \(f(x)=(g+h)(x)\).

We can check this:

\[\begin{align} (g+h)(x)&=g(x)+h(x)\\ &=x^2-3x^2\\ &=f(x) \end{align}\]

Now, let’s look at a product.

Example 14

Write \(f\) as a product of functions, where \[f(x) = x^2\sqrt{x+5}.\]

Here is one way to write \(f\) as a product.

Take \(g(x)=x^2\) and \(h(x)=\sqrt{x+5}\). Then \(f(x)=g(x)\cdot h(x)\).

We can check this:

\[\begin{align} (g+h)(x)&=g(x)\cdot h(x)\\ &=x^2\cdot \sqrt{x+5}\\ &=x^2\sqrt{x+5} \end{align}\]

Next, a composition.

Example 15

Write \(f\) as a composite function, where \[f(x) = \sqrt{x^2 -2}.\]

Here is one way to write \(f\) as a composite.

Take \(g(x)=\sqrt{x}\) and \(h(x)=x^2-2\). Then \(f(x)=(g\circ h)(x)\).

We can check this:

\[\begin{align} (g\circ h)(x)&=g(h(x))\\ &=\sqrt{h(x)}\\ &=\sqrt{x^2-2}\\ &=f(x) \end{align}\]

Now, let’s decompose a more complicated function.

Example 16

Decompose \(f\) into sums, products, quotients, and composites of more elementary functions, where \[f(x) = \dfrac{\sqrt{x^2 + \sqrt{x+1}}}{3x+1}.\]

Here is one way to write \(f\) as a composite.

Take \(g(x)=x^2\), \(h(x)=x+1\), \(j(x)=\sqrt{x}\), and \(k(x)=3x+1\). Then the numerator, \(\sqrt{x^2+\sqrt{x+1}}\) can be broken up like this: - the inside of the square root, \(x^2+\sqrt{x+1}\), is the sum of \(g(x)=x^2\) and \(\sqrt{x+1}\). - the \(\sqrt{x+1}\) can be written as the composite of \(h\) and \(j\). Specifically \(\sqrt{x+1}=\sqrt{h(x)}=(j\circ h)(x)\) - the inside of the square root, \(x^2+\sqrt{x+1}\) is therefore equal to \(g+(j\circ h)\). - the numerator is the square root of that sum, so it can be rewritten as \(j\circ(g+j\circ h)\) - the denominator is simply \(k(x)=3x+1\)

Thus \(f(x)=\left(\frac{j\circ(g+j\circ h)}{k}\right)(x)\)

Let’s decompose an even more complicated function.

Example 17

Decompose \(f\) into sums, products, quotients, and composites of more elementary functions, where \[f(x) = (2x+1)^2 + x\sqrt{\sqrt{x^2 + \frac{\sqrt{x}}{5x^2 + 1}}}.\]

Here is one way to write \(f\) as a composite.

Take

  • \(a(x)=x\)
  • \(b(x)=x^2\)
  • \(c(x)=x+1\)
  • \(d(x)=\sqrt{x}\)

Decompose \(f\) into the following parts

  • \((2x+1)=(c\circ 2a)(x)\) so \((2x+1)^2=[b\circ(c\circ 2a)](x)\)
  • \(\frac{\sqrt{x}}{5x^2+1}=\frac{d}{c\circ(5b)}(x)\), so \(x^2+\frac{\sqrt{x}}{5x^2+1}=\left[b+\frac{d}{c\circ(5b)}\right](x)\)
  • \(\sqrt{\sqrt{x^2+\frac{\sqrt{x}}{5x^2+1}}}=d\circ d\left(b+\frac{d}{c\circ (5b)}\right)(x)\)
  • \(x\sqrt{\sqrt{x^2+\frac{\sqrt{x}}{5x^2+1}}}=a\cdot \left[d\circ d\left(b+\frac{d}{c\circ (5b)}\right)\right](x)\) Thus \(f=[b\circ(c\circ 2a)]+a\cdot \left[d\circ d\left(b+\frac{d}{c\circ (5b)}\right)\right]\)

Computing the Range of a Function

We are going to revisit the idea of a range of a function. First, we restate the range like this:

Range of Function

Suppose that \(f\) is a function from a subset \(D\) of \(\mathbb R\) to \(\mathbb R\).

A real number \(a\) is in the range of \(f\) if there is an \(x\) in \(D\) with \[f(x) = a.\]

In general, computing the range of a function is difficult. For now, we focus on simple examples.

Example 18

Suppose that \[f(x) = \frac{3x+2}{x-1}.\] What is the domain and range of \(f\)?

The domain of \(f\) is \(\mathcal{D}(f)=(-\infty,1)\cup(1,\infty).\)

A real number \(b\) is in \(\mathcal{R}(f)\) if and only if the equation \(f(x)=b\) has a solution. In this example.

\[\begin{align*} f(x)&=b\\ \frac{3x+2}{x-1}&=b\\ 3x+2&=b\cdot(x-1)\\ 3x+2&=bx-b\\ 3x-bx&=-b-2\\ x(2-b)&=-b-2\\ x&=\frac{-b-2}{3-b} \end{align*}\] The solution, \(x\), is a real number if and only if the denominator, \(3-b\) is non-zero. Thus \(b\not 3\). As long as \(b\) is not 3, \(b\) is in the range.

The range is all real numbers except 3; \(\mathcal{R}(f)=(-\infty,3)\cup(3,\infty).\)

Use decomposition to find the domain and range of \(f\).

Example 19

Take \(g\) to be the function that is defined for all \(x\) in \((-\infty, -2]\cup [3, 10)\) by \[g(x) = x+6\quad \text{and take}\quad f = {\rm pow}_{\frac{1}{2}}\circ g.\] Determine the domain and range of \(f\).

The function \(\text{pow}_{1/2}(x)=\sqrt{x}\) has a domain of \([0,\infty)\) and range of \([0,\infty).\)

The function \(f\) is the composite function \(f(x)=\sqrt{g(x)}\).

In order for a real number \(x\) to be in the domain of \(f\), we need \(x\) to be in the domain of \(g\).

The first condition is therefore \(x\in (-\infty,-2]\cup [3,10).\)

Next, since we have \(g\) inside of \(\text{pow}_{1/2}\), we need \(g\geq 0\):

\[ \begin{align*} g(x)&\geq 0\\ x+6&\geq 0\\ x&\geq -6\\ \end{align*} \]

The second condition is therefore \(x\in [-6,\infty)\).

Take the intersection of the first condition and second condition to obtain \[\mathcal{D}(f)=[-6,-2]\cup[3,10).\]

For the range, notice that \(f(x)=\sqrt{x+6}\) is strictly increasing.

The range, can be determined by the extrema of \(f\) on \([-6,-2]\) and \([3,10).\)

  • \(f(-6)=0\), \(f(-2)=2\) gives us that the interval \([0,2]\) is part of the range
  • \(f(3)=3\), \(f(10)=4\) gives us that the interval \([3,4]\) is part of the range

Together, we get \(\mathcal{R}(f)=[0,2]\cup [3,4].\)

Return

  • Return

© Copyright 2025 by the POC Writing Team: Bryan Carrillo, Yat Sun Poon, and David Weisbart. All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopy, recording, or any information storage and retrieval system, without permission in writing from the POC Writing Team.