What is Piecewise function: Definition and 103 Discussions

In mathematics, a piecewise-defined function (also called a piecewise function, a hybrid function, or definition by cases) is a function defined by multiple sub-functions, where each sub-function applies to a different interval in the domain. Piecewise definition is actually a way of expressing the function, rather than a characteristic of the function itself.
A distinct, but related notion is that of a property holding piecewise for a function, used when the domain can be divided into intervals on which the property holds. Unlike for the notion above, this is actually a property of the function itself. A piecewise linear function (which happens to be also continuous) is depicted as an example.

View More On Wikipedia.org
  1. J

    Finding the center of mass of a piecewise function

    I understand that I can divide this shape into a few parallelograms and a triangle and calculate the center of mass of each, but am confused as to what I should do after that. My physics teacher also wants us to use integrals, but I'm assuming I can calculate the COM of each parallelogram and...
  2. MatinSAR

    Derivative of a piecewise function

    ##f(x) = \begin{cases} \frac {x^3-x^2}{x-1} & \text{if } x\neq1 \\ 1 & \text{if } x=1 \end{cases}## Find ##f'(1)##. Using derivative definition: ##f'(1)=\lim_{x \rightarrow 1} {\frac {\frac {x^3-x^2}{x-1}-f(1)} {x-1}}## ##f'(1)=\lim_{x \rightarrow 1} {\frac {\frac {x^3-x^2}{x-1}-1} {x-1}}##...
  3. C

    Graphing a piecewise function (Python)

    I am trying to write a python script to plot the function, Where ##V_0 = 5~V## ##t_0 = 10~ms## ##\tau = 5~ms## My script that I have written to try to do this is, Which plots, However, the plot is meant to look like this with the horizontal line. Can someone please give me some guidance to...
  4. Sciencemaster

    I Piecewise Functions in the Einstein Field Equations

    Let's say I want to describe a massive box in spacetime as described by the Einstein Field Equations. If one were to construct a metric in cartesian coordinates from the Minkowski metric, would it be reasonable to use a piecewise Stress-Energy Tensor to find our metric? (For example, having...
  5. N

    Investigating Limit of Piecewise Function

    Use the graph to investigate (a) lim of f(x) as x→2 from the left side. (b) lim of f(x) as x→2 from the right side. (c) lim of f(x) as x→2. Question 20 For part (a), as I travel along on the x-axis coming from the left, the graph reaches a height of 4. The limit is 4. It does not matter...
  6. N

    Investigate Limit of Piecewise Function

    My apologies. I posted the correct problem with the wrong set of instructions. It it a typo at my end. Here is the correct set of instructions for 28: Use the graph to investigate limit of f(x) as x→c. If the limit does not exist, explain why. For (a), the limit is 1. For (b), the limit DOES...
  7. M

    MHB Piecewise function: differentiable but not continuously differentiable

    Hey! :giggle: We have the function $$f(x,y)=\begin{cases}x^2\sin\left (\frac{1}{x}\right )+y^2\sin\left (\frac{1}{y}\right ) & \text{ if } xy\neq 0 \\ x^2\sin\left (\frac{1}{x}\right ) & \text{ if } x\neq 0, y=0 \\ y^2\sin\left (\frac{1}{y}\right ) & \text{ if } x= 0, y\neq 0 \\ 0 & \text{ if...
  8. E

    MHB Integrating a piecewise function?

    I have to find: g(1)= and g(5)= I have drawn the graph and I am a little unsure where to go from there. I know area is involved somehow but not entirely sure what to do. Any help is appreciated
  9. M

    B Critical point of a piecewise function

    If the function is not differentiable at point. Can we consider this point is critical point to the function? f(x) = (x-3)^2 when x>0 = (x+3)^2 when x<0 he asked for critical points in the closed interval -2, 2
  10. S

    I Rewriting a piecewise function using step functions

    Suppose we have a piecewise function f(t) = exp(c*t) when 0 <= t < 2 and f(t) = 0 when t >= 2. Can the above be rewritten as f(t)= exp(at)*[H(t-0) - H(t-2)], H is a heaviside function.
  11. K

    Piecewise Function: Intervals of Increase/Decrease & Extremes/Asymptotes

    a) At which intervals are f strictly increasing and at what intervals are f strictly decreasing. Should I just find the derivative of both of the functions? If so, I get that the function is increasing at the intervals (−∞,0) and (0,∞). Is this right, or can I just say that the function is...
  12. C

    Mathematica Defining a piecewise function in Mathematica

    Hello everyone. I am trying to do a 2D Shannon interpolation, but I cannot use a sinc because later on this expression goes in an optimization software that doesn't recognize it. I have defined my own version of sinc as: sincC = Piecewise[{(Sin[Pi* #]/(Pi*(#))), # >= 1}, {1 - (#^2)/6 +...
  13. NP04

    Finding the limits of a piecewise function

    Problem Statement: Determine whether f is continuous at c. (see image for piecewise function f) EDIT: Sorry if it is a little blurry that is x^3 in the numerator of the rational function and x^2 in the denominator Relevant Equations: Basic understanding of limits My work: Since the...
  14. V

    Proving the range of a piecewise function

    Homework Statement Allow f:ℤ→ℤ be defined by, for all n∈ℤ f(n) = {n-1 if n is even, n+5 if n is odd Prove that ran(f) = ℤ Homework EquationsThe Attempt at a Solution I am unsure of how exactly to prove this due to the fact now I am working with a piecewise function. Here is what I have so...
  15. C

    Converting a Piecewise function to a Heaviside function

    Homework Statement Use the Heaviside function as an on the switch over the interval [a,b]. Homework Equations Let the H(x) be the Heaviside function defined as a piece-wise function such that it is zero if x is less than zero, and 1 if it is greater than or equal zero. From that, we can use the...
  16. Mr Davis 97

    Show that this piecewise function is continuous at 0

    Homework Statement ##f(x) = x \sin (\frac{1}{x})## for ##x \ne 0## and ##f(0) = 0##. Prove that this function is continuous at 0. Homework EquationsThe Attempt at a Solution First, I need to look at the quantity ##|f(x) - f(0)|##. However, I am not completely sure how to proceed. I would think...
  17. G

    Calculus-I: discontinuity of piecewise function HW problem

    Screenshot of my homework problem along with my solution so far. I'm not sure if I'm doing this correctly and if I am... if I'm answering correctly. Thank you. (EDIT: I made 1 small error with the piecewise definition. Ignore the f(x) before g(x).)
  18. M

    Mathematica Piecewise Function for Integration | PF Code Troubleshooting

    Hi PF! I have a function ##\phi ns## defined below, and ##\phi ns## is continuous everywhere except ##s=0##, where it is singular. However, ##\lim_{s\to 0}\phi ns(s) = 0##, and since I'm integrating in this domain I thought I would define a new function ##\phi nsP## such that ##\phi...
  19. R

    Piecewise Function: Find Expression for Graph | Homework Help

    Homework Statement Hello I uploaded a picture of the image. Find an expression for a function who's graph is the given curve. Homework EquationsThe Attempt at a Solution The first function [0,3] y= -x+3 and the second one is y=2x-6 from 3 to 5 what I don't get, is why isn't the second one...
  20. M

    Transforming Piecewise Functions

    Homework Statement The piece wise function is -x-2, x<-1 x^2-3x, -1≤ x ≤5 3x+5, x>5 The problem is to transform the function with...
  21. T

    Fourier Series of a Piecewise Function

    Homework Statement f(x) = -1, -π ≤ x ≤ 0 2, 0 ≤ x ≤ π Given this find the Fourier series using both $$a) \sum_{n=-∞}^\infty a_n e^{inx}$$ $$b) \sum_{n=0}^\infty [A_n cos(nx) + B_n sin(nx)]$$ Homework Equations $$a_o = \frac {1} {2L} \int_{-L}^L f(t) \, dt $$ $$a_n = \frac {1} {L}...
  22. J

    Find A and B so that F(x) is a Differentiable Function

    Homework Statement Find the values of a and b that make f a differentiable function. Note: F(x) is a piecewise function f(x): Ax^2 - Bx, X ≤ 1 Alnx + B, X > 1 Homework EquationsThe Attempt at a Solution Made the two equations equal each other. Ax^2 - Bx = Alnx + B Inserting x=1 gives, A - B =...
  23. cg78ithaca

    A Taylor/Maclaurin series for piecewise defined function

    Consider the function: $$F(s) =\begin{cases} A \exp(-as) &\text{ if }0\le s\le s_c \text{ and}\\ B \exp(-bs) &\text{ if } s>s_c \end{cases}$$ The parameter s_c is chosen such that the function is continuous on [0,Inf). I'm trying to come up with a (unique, not piecewise) Maclaurin series...
  24. TheSodesa

    The period, angular frequency of a piecewise function

    Homework Statement The function ##f## is defined as follows: \begin{equation*} f(t) = \begin{cases} 1, \text{ when } 2k < t < (2k+1),\\ 0, \text{ when } t = k,\\ 2, \text{ when } (2k-1) < t < 2k, & k \in \mathbb{Z}\\ \end{cases} \end{equation*} What is the period ##T## of the function ##f##...
  25. Houeto

    A Fourier Transform of a piecewise function

    Here is the Problem Statement : Find Fourier Transform of the piecewise function Can someone sheds some lights on how to start solving this? Thanks
  26. lep11

    Calculate limit of piecewise function

    Homework Statement a.) Let ##f,g:ℝ→ℝ## such that ##g(x)=sin x## and ##f(x)= \left\{ \begin{array}{ll} x^2, x∈ℚ \\ 0 , x∈ℝ\setminusℚ \\ \end{array} \right. ##. Calculate ##\lim_{x \rightarrow 0} \frac{f(x)}{g(x)}##. b.) Why l'Hospital rule cannot be applied here?The Attempt at a...
  27. A

    Absolute function into piecewise function

    Homework Statement Write F(x)= x2-5|x| as a piecewise function Homework EquationsThe Attempt at a Solution I was writting it out and came to Fx= x2-5(x) and x2-5(-x) but my book says that it comes out to be x2-5 x2-5(-x) I imagine there is a very simple reason why the x in the first one...
  28. R

    Convolution Calculation (piecewise function)

    Homework Statement Compute the convolution ##(f*h)(t)## where $$f(t) = \left\{\begin{matrix}1, \ \ for \ \ |t|<1 \\ 0, \ \ \ \ otherwise \end{matrix}\right.$$ and $$h(t) = \left\{\begin{matrix}2|t|-1, \ \ for \ \ |t|<1/2 \\ 0, \ \ \ \ otherwise \end{matrix}\right.$$ Homework Equations...
  29. Alanay

    -66 over -99 into a graph?

    Okay, so I'm down to the last equation. -12/11 x 10 + 54/11 I get -66/-99. Is this right? If so how do I put it into the graph. -12/11 x 10 = -120/110 + 54/11 = -66/99 (I think I've went wrong somewhere)
  30. K

    Mathematica FindMaximum function in Mathematica

    I recently plotted a piecewise function: Plot[Piecewise[{{1 - Exp[-.002*t], 0 <= t < 120}, {-Exp[-.002*t] + Exp[-.002*(t - 120)], 120 <= t}}], {t, 0, 5000}, PlotRange -> {0, 0.25}] I then defined the function which I am calling q[t_] as follows: q[t_] := Piecewise[{{1 -...
  31. K

    Mathematica Troubleshooting Mathematica Plotting Problem

    Homework Statement I've entered the following piecewise equation into Mathematica: Plot[Piecewise[{{sin (t), 0 <= t < \[Pi]}, {5 + 5 cos (t) + sin (t), \[Pi] <= t < 4*\[Pi]}, {10 cos (t) + sin (t), 4*\[Pi] <= t}}], {t, 0, 20*\[Pi]}] But I am getting a blank graph in return. I've proofread my...
  32. A

    Finding limits to a piecewise function (3 pieces)

    Homework Statement f(x)=-2 when x<1 =3 when x=1 =x-3 when x>1 find the limit at 1 from the left and right sides and at 1. Homework EquationsThe Attempt at a Solution limit for x when approaching 1 from the left is -2 limit for x when approaching 1 from the right is -2 -I'm not sure...
  33. Feodalherren

    Laplace transform of a piecewise function

    Homework Statement f(t) = e^t when 0≤t<1 and 0 when t≥1 Homework Equations Laplace transformations The Attempt at a Solution so the Laplace integral becomesfrom 0 to 1 ∫e^(st^2)dt + 0 how do I integrate this?
  34. S

    MHB Write the piecewise function in terms of unit step functions.

    Write the piecewise function \[ f(t) = \begin{cases} 2t, & 0\leq t < 3 \\ 6, & 3 \le t < 5 \\ 2t, & t \ge 5 \\ \end{cases} \] in terms of unit step functions. So here is what i;ve got just guessing , I don't think I'm correct. I really need some help. But I got...
  35. V

    Multivariate piecewise fxn continuity and partial derivative

    1. Problem Define a function: for t>=0, f(x,t) = { x for 0 <= x <= sqrt(t), -x + 2sqrt(t) for sqrt(t) <= x <= 2sqrt(t), 0 elsewhere} for t<0 f(x,t) = - f(x,|t|) Show that f is continuous in R^2. Show that f_t (x, 0) = 0 for all x. Then define g(t) = integral[f(x,t)dx] from -1 to 1. Show...
  36. S

    Piecewise linear programming

    Dear Friends I have a question about linear programming. It would be great to have your comments or suggestions. Consider the followings \begin{equation} \\ Y = [y_{1}, y_{2}, \cdots, y_{n}] \\ G = [g_{1}, g_{2}, \cdots, g_{n}] \\ \textbf{X} = \begin{pmatrix} 0 & x_{1,2} & \cdots & x_{1,n}...
  37. N

    Filling in piecewise function from given graph

    Homework Statement Homework Equations The Attempt at a SolutionNot sure what to do here. I was thinking maybe the y – y1 = m(x – x1)? I am having trouble understanding this question. I know what piecewise functions are but filling this in is proving difficult.
  38. N

    Making a piecewise function continuous everywhere

    Homework Statement Given the piecewise function f(x) = \left\{ \begin{array}{lr} \frac{(2-x)^2-p}{x} &: x < q\\ r(x+6) &: q \leq x <2 \\ x^3-p &: x \geq 2 \end{array} \right. Find the values of p,q,r such that f(x) is continuous everywhere and f(2) = p The Attempt at a Solution Since f(2)...
  39. A

    MHB Continuity of piecewise function of two variables

    The question looks like this. Let $f(x, y)$ = 0 if $y\leq 0$ or $y\geq x^4$, and $f(x, y)$ = 1 if $0 < y < x^4 $. (a) Show that $f$ is discontinuous at (0, 0) (b) Show that $f$ is discontinuous on two entire curves. In regarding (a), I know $f(x, y)$ is discontinuous on certain...
  40. A

    Continuity of piecewise function of two variables

    The question looks like this. Let ##f(x, y)## = 0 if y\leq 0 or y\geq x^4, and f(x, y) = 1 if 0 < y < x^4 . (a) show that f(x, y) \rightarrow 0 as (x, y) \rightarrow (0, 0) along any path through (0, 0) of the form y = mx^a with a < 4. (b) Despite part (a), show that f is discontinuous at (0...
  41. Dethrone

    MHB Epsilon Delta Proof Piecewise function

    https://answers.yahoo.com/question/index?qid=20130915100124AAK4JAQ I do not understand how they got: "1 = |(1 plus d/2 - L) - (d/2 - L)| <= |1 plus d/2 - L| plus |d/2 - L| < 1/4 plus 1/4 = 1/2, " Shouldn't it be $|(1+ \frac{\delta}{2} -L) + (\frac{\delta}{2} -L)|$, not $|(1+ \frac{\delta}{2}...
  42. Dethrone

    MHB Piecewise function - rational and irrational

    $$g(x)=\begin{cases}x^2, & \text{ if x is rational} \\[3pt] 0, & \text{ if x is irrational} \\ \end{cases}$$ a) Prove that $\lim_{{x}\to{0}}g(x)=0$ b) Prove also that $\lim_{{x}\to{1}}g(x) \text{ D.N.E}$ I've never seen a piecewise function defined that way...hints?
  43. Dethrone

    MHB Find f'(0) from a piecewise function

    Find $f'(0)$ if: $$f(x)=\begin{cases}\frac{g(x)}{x}, & x\ne 0 \\[3pt] 0, & x=0 \\ \end{cases}$$ where $g(0)=g'(0)=0$, $g''(x)=17$ and $g''(x)$ is continuous at $0$. Progress: First, $$f'(x)=\begin{cases}\frac{xg'(x)-g(x)}{x^2}, & x\ne 0 \\[3pt] 0, & x=0 \\ \end{cases}$$ Wouldn't $f'(0)$...
  44. STEMucator

    Piecewise Function in MATLAB

    Homework Statement Hey there. I'm trying to plot a piecewise function in MATLAB and I'm having some decent success, but there's some things I'm wondering. Here's the function: http://gyazo.com/d3493a0c13096878acf5a501af8a7f66 Homework Equations The Attempt at a Solution My...
  45. Petrus

    MHB Piecewise function Continuous

    Hello MHB, If I want to decide constant a and b so its continuous over the whole R for this piecewise function basicly what I got problem with is that x^{1/3} is not continuous for negative value so it will never be continuous for any value on constant a,b. I am missing something? or do they...
  46. B

    Proving piecewise function is integrable

    Homework Statement Prove the function ##f(x):[2,4]\rightarrow\mathbb{R}## defined by ##f(x) =\begin{cases} x, & \text{if }2\leq x\leq 3 \\2, & \text{if } 3<x\leq 4 \end{cases}## is Riemann IntegrableHomework Equations A function ##f:[a,b]\rightarrow\mathbb{R}## is integrable iff for each...
  47. 9

    Piecewise function: check answer

    Homework Statement Make a piecewise function. If possible, please check my work. - Salesperson has salary of $500. - On first 10 000 of sales, earns 10% commission. - On next 10 000 of sales, earns 20% commission. - Earns 25% commission on any additional sales. (note: didn't simplify to...
  48. L

    Composite function of a piecewise function

    Homework Statement Given that I have a doubling function : f(x)=2x (for 0≤x<0.5) and 2x-1 (for 0.5≤ x<1) Homework Equations What is f(f(x))? The Attempt at a Solution f(f(x))=4x for the first one and 4x-3 for the second part but not sure what to do about the domain...
  49. T

    MHB Help finding the local min in a piecewise function

    f(x) = { { 16 - x^2, if -4 <= x <= 0 { 2x - 3, if 0 <= x <= 4 I did the first derivative test and got zero but i don't think that's right. Any help?
  50. L

    Continuity and differentiability of a piecewise function

    Homework Statement Discuss the continuity and differentiability of f(x) = \begin{cases} x^2 & \text{if } x\in \mathbb{Q} \\ x^4 & \text{if } x\in \mathbb{R}\setminus \mathbb{Q} \end{cases} Homework Equations The Attempt at a Solution From the graph of ##f##, I can see...