# I am having trouble formatting the formula for a quoted vector magnetic potential inside and outside a shell of radius R with charge density sigma

I am having trouble formatting the following formula as a reference to MSU's result for the magnetic field inside a spherical shell and the vector magnetic potential outside the magnetic shell.

$$\overrightarrow{B} = \overrightarrow{\nabla} \times \overrightarrow{A}$$

The vector magnetic potential on the MSU website is (picture version):

That website shows that the magnetic field is constant inside the shell as:

$$\overrightarrow{B} = ({2}/{3}) \mu_0 \sigma \overrightarrow{\omega}$$

I want to format everything within MathJax for Stack Exchange Math instead of using pictures (which is discouraged if at all possible).

$$D_{it} = \bigg {if \ bank \ i \ issues \ ABS \ at \ time \ t \\ 2 \ if \ bank \ i \ issue \ CBs \ at \ time \ t \\ \ 0 \ otherwise }$$

But this large left bracket reference is not working for me. Instead of the expected output, I am getting:

Someone helped me to understand the necessary text inside the question to format the ** magnetic potential $$\overrightarrow{A}$$ **, with the two lines to the right and the text "for points inside the sphere" and "for points outside the sphere" aligned together at the left, to properly reference for the equation.

The example given there is:

$$f(n) = \begin{cases} n/2, & \text{if n is even} \\ 3n+1, & \text{if n is odd} \end{cases}$$

I am pretty sure that this referenced example solves the puzzle, but I am in the middle of testing it. Thank you, the-amplitwist so much for your comment that I just now upvoted.

My attempt to implement it for the referenced formula (in-the-works-still now) is below:

$$\overrightarrow{A}(\overrightarrow{r}) = \begin{cases} n/2, & \text{if n is even} \\ 3n+1, & \text{if n is odd} \end{cases}$$

My attempt to use *bigg with the new formatting example:

$$\overrightarrow{A}(\overrightarrow{r}) = \begin{cases} n/2, & \text{if n is even} \\ \\ 3n+1, & \text{if n is odd} \end{cases}$$

$$\bigg {\uparrow}$$

I think that I am over the major hurdle, but I just want to make sure that the example is complete to reference in the future. I am not sure if the Bigg part is going to work still and I need to test it further. If I need to use something else besides Bigg to get the large left bracket, please let me know. I tried searching for Bigg at the formatting reference, but nothing came up.

I found another reference to bigg for an arrow. The reference works fine as the up-arrow indeed is big. But when I try to apply it to the formula example I still get an error.

If it is possible to help me find out how to get the text larger (so it is easier to read), I would appreciate it.

I am now making another attempt at solving this issue, starting with the approach from a given answer:

$$\overrightarrow A(\overrightarrow r)= \begin{cases} \frac{\mu_0 R \sigma}{3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points inside the sphere} \\ \frac{\mu_0 R^4 \sigma}{3r^3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points outside the sphere} \end{cases}$$

I am trying to make the inside characters big to force the entire equation to render as big, starting with a previous answer that seems to have been deleted, which was:

I start with the answer from Peter Phipps:

$$\overrightarrow A(\overrightarrow r)= \begin{cases} \frac{\mu_0 R \sigma}{3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points inside the sphere} \\ \frac{\mu_0 R^4 \sigma}{3r^3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points outside the sphere} \end{cases}$$

Next, I try to make the inside characters big using dfrac instead of frac:

$$\overrightarrow A(\overrightarrow r)= \begin{cases} \dfrac{\mu_0 R \sigma}{3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points inside the sphere} \\ \dfrac{\mu_0 R^4 \sigma}{3r^3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points outside the sphere} \end{cases}$$

The MathJax code is as follows, starting with a paste and then {} pre-formatted text to get it to quote without the MathJax symbols:

$$\overrightarrow A(\overrightarrow r)= \begin{cases} \dfrac{\mu_0 R \sigma}{3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points inside the sphere} \\ \dfrac{\mu_0 R^4 \sigma}{3r^3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points outside the sphere} \end{cases}$$


I am giving Peter Phipps an up-vote because he got me 90% to the final solution. Thank you Peter and community! If the question and answers are helpful, I appreciate your further votes for him too.

• I tried editing the formula with a left and right closing bracket; it did not help. Saving the question seemed to change the output of the formula a little bit, but did not completely work still. I still need additional help because the multi-line output to the right of a large left-bracket is still not working for me, as referenced elsewhere on Stack Exchange. Jun 26 at 12:35
• You probably want to use "Definitions by cases (piecewise functions)" from the MathJax basic tutorial. Just have a look at it, and see if you're able to adapt it for your needs. As an aside, it may be more convenient for you to ask about this in the MathJax chatroom, since chat allows for more back-and-forth. Jun 26 at 12:51
• Glad to be of help. I would encourage you to make use of the sandbox to test the MathJax code to your satisfaction. The purpose of the sandbox is to allow these kind of edits in a non-intrusive way: note that each edit of your post bumps it to the top of the list of active questions on the Meta homepage, and other users may find this distracting. Jun 26 at 13:12
• @TheAmplitwist's suggestion (as in @‍PeterPhipps's answer) is just right, but let me emphasise: please do not use that code from StackExchange. It is poor LaTeX for a variety of reasons, and the rendered result doesn't seem to be anything like what you want. (The problem with it not rendering at all seems to be that you have included a } that doesn't belong.) Jun 26 at 17:06
• In the original cut and paste picture of the formula, the text is clear and easy to read. I was still looking for something equivalent to Bigg because the text in the answer - although accurately showing the equation - is small and how to view and it does not represent the formatting of the original equation that is clearer. I am still not sure if this is the best approach or if it is better to cut and paste the clearer picture of the equation text. Jun 27 at 10:41

## 1 Answer

This should get you started. As learning anything new it's a matter of experimenting and seeing what you get.

$$ \overrightarrow A(\overrightarrow r)=  \begin{cases} \frac{\mu_0 R \sigma}{3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points inside the sphere} \\  \frac{\mu_0 R^4 \sigma}{3r^3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points outside the sphere} \end{cases} $$

$$\overrightarrow A(\overrightarrow r)= \begin{cases} \frac{\mu_0 R \sigma}{3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points inside the sphere}\\ \frac{\mu_0 R^4 \sigma}{3r^3} \left(\overrightarrow \omega \times \overrightarrow r\right), \quad\text{for points outside the sphere} \end{cases}$$

• \overrightarrow sizes automatically, and \vec doesn't; the OP might want to experiment. \left(\right) for all parenthesis pairs (without "tall" content) might be dispreferred. Finally, {cases} can automatically align the condition: $$\newcommand\v{\vec}\v A(\v r)=\begin{cases}\frac{\mu_0R\sigma}3(\v\omega\times\v r),&\text{for points inside the sphere}\\ ...&\text{ouside} \end{cases}$$ \vec A(\vec r) = \begin{cases} \frac{\mu_0 R\sigma}3(\vec\omega \times \vec r), & \text{for points inside the sphere} \\ ... & \text{ouside} \end{cases}, truncated for want of space, may be closer. Jun 26 at 17:03
• (Re$\def\o{\overrightarrow}$, of course whether to use \left(\right) when they're not strictly needed is a design choice, but notice that it does affect the rendered result, in the height (obviously) but also the spacing, not just the source: $\left(\o\omega \times \o r\right),$ \left(\overrightarrow\omega \times \overrightarrow r\right), vs. $(\o\omega \times \o r),$ (\overrightarrow\omega \times \overrightarrow r),.) Jun 26 at 17:09
• @LSpice, As I said, my answer was just a start. There are usually several ways to do these things. Jun 26 at 18:23
• Re, right, understood. The problem is that new users sometimes see something that works and don't necessarily explore other ways that might also work, so I just wanted to point out some avenues along which exploration might go. Jun 26 at 20:24