 Hello there and welcome to video five in the introduction to latex series. In this video we're going to look at two front to back examples where we typeset the quadratic formula and the definition of the derivative from calculus and this should put together everything that we've learned so far. So let's start with the quadratic formula and the way I'm going to do this is write out the quadratic formula first and then we'll go into latex to typeset up. So we know the quadratic formula says if ax squared plus bx plus c equals zero then and the quadratic formulas result is pretty important so I'm going to use displayed mode to set this off and write or eventually typeset x equals negative b plus or minus the square root of b squared minus 4ac over 2a. So there's the quadratic formula and just looking at the formula and thinking ahead as to what I'm going to have to do in latex. I see a couple of places where there are some exponents to take care of. This is going to be an inline math mode. All this stuff is going to be in displayed math mode. There's a root with a bunch of things under it, a fraction with some pretty large, with a pretty large numerator. Then finally there's the plus minus sign which we haven't learned so I'm going to have to go look that up. So let's go over into Scribtech and start typing up the latex for this. So now here we are in Scribtech with an outline of a document already set up. One new thing you see here in the third line is a comment. You can always add comments into your latex code just like you might do if you're writing a computer program. The percent symbol at the beginning of a line indicates that everything on that line is going to be a comment. It will appear in the raw source code for your latex file but will not appear in the output. So if you need to leave yourself a note or somebody else a note explaining what is happening in a certain place that's how to do it. So let's try to do what we can with the tools we have to set up what we hand wrote a minute ago. So first line is going to say if that's easy enough and then we're going to put the quadratic equation in inline math mode. So one dollar sign and then it was AX, AX squared and so to get the exponent I type a carrot symbol that shifts six and then a two and just for clarity I'll put a space there plus BX plus C equals zero. I'll close out math mode with another dollar sign comma then and now here's where I switch into displayed math mode. I'm going to put two spaces here. The extra space doesn't really matter. All you need is really one space. This helps the source code to be a little more readable. Then I'll begin displayed mode, displayed math mode with a double dollar sign and then I'll need X equals. Everything to the right of the equal sign is a fraction. So I'm going to start with slash FRAC, two sets of curly braces, one for the numerator and the other for the denominator and let's go ahead and close off the math mode here. Now let's just fill in the blanks. In the numerator I'm going to have negative B and here's where we come to something we haven't learned yet. We are needing the plus and minus symbol and we haven't seen that so what I've got over here on an extra tab is that comprehensive latex symbol guide that we mentioned in the last video and I've gone to the page here where it starts on mathematical symbols and I can just start doing a search here until I see what I need and I see there it is slash PM gives me the plus minus symbol. This very frequently has to happen. I could have also gone over to detectify and tried writing that in but very often you're going to need a symbol that you haven't ever seen before. No problems. Just go to the document or detectify or web equation and look it up. So let's go back and put in slash PM. Now what happens next is a square root. So I'm going to type slash SQRT and then another set of curly braces for the argument of the square root. So now inside the square root symbol let's put what we need that would be B squared again with the curate key there to get the 2 as an exponent minus 4AC and we're all done. So now I'm going to go with the denominator and just type 2A. That's all I need to type S so I'm just going to click compile and over my other tab I see that I do have what I needed. Let's zoom in so we can get a really good look at it. So that's nice looking math. Now let's try another famous equation for mathematics and that's the definition of the derivative and calculus at least as it appears in some textbooks. So the way you might see this written out in the textbook is to say let F, that's a variable F now, be a function. Let F be a function. Then, and here I'm going to put the definition which again it's important so that's what displayed math mode is for, F prime of X equals limit as delta X approaches zero of a fraction again, F of X plus delta X minus F of X over delta X and in this one we have a little bit of trailing text that would have to go back in line and that is to say that's the derivative if the limit exists. So this equation is very similar in how it will be latexed up to the quadratic formula with a few twists. I need to get this delta into the game here in three different places. There's an arrow that I need to find and also I need to think about a mathematical limit command here. If I just type L I am, I don't know if that's going to look quite right. So let's go over to our editor and start latexing it up. So over here in the editor I have put in another comment to indicate to myself in the source code that I'm starting a new section. Let's just type what we can let F in math mode, of course, because F is a variable, be a function. Then I'm going to go into displayed math mode this time. So $2 signs F. The prime we're just going to use an apostrophe straight off the keyboard of X equals and now I need the limit. If I just type L I am, it's not going to look quite right. It will look like a variable L next to a variable I next to a variable M. I want the L I am to look almost like it is just regular text. This is actually command I'm going to use. I don't know necessarily what that command is. So I'm going to go back to my comprehensive symbol list. I have no idea where it is. So I can just do a quick search for L I am and brings me a lot of things, many of which are substrings or something else I don't want like delimiters. So let me advance this to the next place where I see this showing up somewhere around in here. I'm going to look for L I am L I am. This can be a fairly time. I think I found it. I think I found it. There it is slash L I am under log like symbols. So slash L I am fairly logical. So I'm going to go and put slash L I am now to get the delta X approaches zero underneath. I'm just going to subscript and many commands like limits or sigma notation that you use for summing in displayed mode. Subscripts are actually go directly underneath the symbol, not just like as a as an index subscript. And that's going to be the case for limit too. So I'm going to put just a regular subscript underscore here. Now what I'm subscripting here is not just one variable, but actually several things. I need a delta, I need an X, I need a right pointing arrow, and I need a zero. So in order to get all of that stuff to be subscripted, I need a set of curly braces. So everything that I put inside the curly braces at this point is going to go underneath the L I am. Now what is going to go in here is a capital delta. Not a lower case delta, but a capital delta X. I need a right pointing arrow. And I could go back to my comprehensive symbol list and do that. Or I can go over to detectify because this is just a single symbol. And so detectify ought to work pretty well. Let me just see if I can draw a right pointing arrow. And it will think for a minute and eventually come back with hopefully something that's close to the right thing. In fact, there's several things that could be interpreted as this just a straight right arrow, I think will be fine for what we need. So let's go back to here. And I'll put right arrow. I'll also say just the command slash to two will also work here. And put zero. And now the hard part is basically over. I need a fraction numerator denominator. And this the top of the fraction is F of X plus capital delta X minus F of X. And then in the denominator, it's just a capital delta X close off the displayed mode. And then the trailing text here said if the limit exists. So that ought to do it. Let's go over and compile it. And indeed we have our limit definition right here. And once again, just notice if I could zoom in on the limit definition looking underneath the limit, notice that the limit actually appears as regular text, which is how it's supposed to and everything that we put inside the curly braces is a subscripted underneath that limit as it should be.