Cut'n'Paste
Piecewise defined functions

 

Piecewise function definitions. Replace expn with your expressions, condn with conditions. Once inserted you can edit these with the MathML editor. If you wish to change the style of brace you can do it here, just change the { in the code below to [ or (, etc.

Similarly the space between the expressions and the definitions can be changed by changing the expressions mspace width='10pt'

 

To use this code: Copy the appropriate code piece below and paste it into the MathML tab of the Equation Editor. Note that you must delete the line of code that is already in that Tab before pasting the following in!

Three-part function:

<math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi mathvariant="italic">f</mi> <mfenced open="(" close=")"> <mrow> <mi mathvariant="italic">x</mi> </mrow> </mfenced> <mo>=</mo> <mfenced open="{" close=""> <mrow> <mfenced separators="," open="" close=""> <mrow> <mtable rowalign="baseline" columnalign="center" groupalign="{left}" rowspacing="1.0ex"> <mtr> <mtd> <mrow> <mi mathvariant="italic">exp1</mi> <mspace width="10pt" /> </mrow> </mtd> <mtd> <mrow> <mi mathvariant="italic">cond1</mi> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mi mathvariant="italic">exp2</mi> <mspace width="10pt" /> </mrow> </mtd> <mtd> <mrow> <mi mathvariant="italic">cond2</mi> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mi mathvariant="italic">exp3</mi> <mspace width="10pt" /> </mrow> </mtd> <mtd> <mrow> <mi mathvariant="italic">cond3</mi> </mrow> </mtd> </mtr> </mtable> </mrow> </mfenced> </mrow> </mfenced> </mrow> </math>

 

Two-part function:

<math> <mrow> <mi>f</mi> <mfenced open="(" close=")"> <mrow> <mi mathvariant="italic">x</mi> </mrow> </mfenced> <mo>=</mo> <mfenced separators="," open="{" close=""> <mrow> <mtable rowalign="baseline" columnalign="center" groupalign="{left}" rowspacing="1.0ex"> <mtr> <mtd> <mrow> <mi mathvariant="italic">exp1</mi> <mspace width="10pt" /> </mrow> </mtd> <mtd> <mrow> <mi mathvariant="italic">cond1</mi> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mi mathvariant="italic">exp2</mi> <mspace width="10pt" /> </mrow> </mtd> <mtd> <mrow> <mi mathvariant="italic">cond2</mi> </mrow> </mtd> </mtr> </mtable> </mrow> </mfenced> </mrow> </math>

Cut'N'Paste Index

Main Index

Updated: 1/21/2020 SMS/DAG