Compare commits

..

No commits in common. "master" and "physics-soup" have entirely different histories.

48 changed files with 891 additions and 15507 deletions

View File

@ -1,88 +0,0 @@
# Contributing guidelines
If you would like to add or fix any content in this project, you will need to ensure that your changes retain the same style as the rest of the repository. The Eifueo project consists of multiple (mostly) standard Markdown documents.
## General Markdown
Even Markdown has multiple implementations, and prior knowledge of the markup language is required for contributions. For the following stylistic elements, the following symbols should be used:
- `**Bold text**`: **Bold text**
- `*Italicised text*`: *Italicised text*
- `***Bold and italicised text***`: ***Bold and italicised text***
If a phrase would be bolded, do not bold any surrounding punctuation. If a phrase would be italicised, italicise any surrounding punctuation.
Tables must contain exactly one space between content and the vertical bars.
```
| Heading 1 | Heading 2 | Heading 3 |
| :-- | --- | --: |
| Left justify | Normal justify | Right justify |
```
| Heading 1 | Heading 2 | Heading 3 |
| :-- | --- | --: |
| Left justify | Normal justify | Right justify |
Lists must use hyphens with a space before and after. There should be newlines before and after lists.
There should be a newline before and after headings, except for headings that start a file. There should also be a space after a heading number sign.
```
### Heading example
Pomme de terre!
```
### Heading example
Pomme de terre!
Links to images must be either from Kognity or available for free non-commercial use. They should be sent to the site administrator's email to be loaded in as a static local asset. Images should be linked using HTML, have a maximum width of 700 pixels, contain a reference to the source organisation, and fit the overall theme of the site. The link to the image path is `/resources/images/image.file-extension`. If possible, PNGs are preferred. Images should be relevantly named in lowercase with hyphens separating words.
`<img src="/resources/images/velocity-time-graph.png" width=700>(Source: Kognity)</img>`
## Special Markdown
Math is written in LaTeX and is rendered using MathJax.
`$Inline math: 1+2=3$`: $Inline math: 1+2=3$
Display math should always be on its own line. Multi-line math should have dollar signs on their own lines. There should always be a newline after display math.
```
Proof that 1 + 1 is 2:
$$display math: 1+2=3$$
More proof:
$$
1 + 1 = x \\
1 + 1 = 2
$$
```
Proof that 1 + 1 is 2:
$$display math: 1+2=3$$
More proof:
$$
1 + 1 = x \\
1 + 1 = 2
$$
Admonitions are provided by `mkdocs-material-extensions` and documentation for them can be found [here](https://squidfunk.github.io/mkdocs-material/reference/admonitions/#usage). The types used in Eifueo are `example`, `definition`, `note`, and `info`. **The use of admonitions should be minimised, aside from example admonitions**.
## Writing style
This repository uses, unfortunately, my own personal style of English that is a mix of British and American English.
- Titles should be written in sentence case
- List items should have their first letter capitalised
- "-ize" words should be written in the British form ("-ise")
- "-or" words should be written in the British form ("-our")
- "-ph-" words should be written in the American form ("-f-")
- Punctuation follows quotes ("'content', more content")
- Quotes should follow the American style ("'It was a potato,' he said.")
Most areas should be written in paragraphs, when possible, using a mostly formal tone.
The primary focus of this project is organisation and brevity. This is not a textbook; there should not be unnecessary fluff nor examples in the main body text if it can be avoided. Examples should go in admonitions instead. Especially long admonitions should use `???` to make them collapsable.

View File

@ -1,351 +1,412 @@
### GNU Free Documentation License ### GNU GENERAL PUBLIC LICENSE
Version 1.3, 3 November 2008 Version 3, 29 June 2007
Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Copyright (C) 2007 Free Software Foundation, Inc.
Inc. <https://fsf.org/> <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed. license document, but changing it is not allowed.
#### 0. PREAMBLE ### Preamble
The purpose of this License is to make a manual, textbook, or other The GNU General Public License is a free, copyleft license for
functional and useful document "free" in the sense of freedom: to software and other kinds of works.
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of "copyleft", which means that derivative The licenses for most software and other practical works are designed
works of the document must themselves be free in the same sense. It to take away your freedom to share and change the works. By contrast,
complements the GNU General Public License, which is a copyleft the GNU General Public License is intended to guarantee your freedom
license designed for free software. to share and change all versions of a program--to make sure it remains
free software for all its users. We, the Free Software Foundation, use
the GNU General Public License for most of our software; it applies
also to any other work released this way by its authors. You can apply
it to your programs, too.
We have designed this License in order to use it for manuals for free When we speak of free software, we are referring to freedom, not
software, because free software needs free documentation: a free price. Our General Public Licenses are designed to make sure that you
program should come with manuals providing the same freedoms that the have the freedom to distribute copies of free software (and charge for
software does. But this License is not limited to software manuals; it them if you wish), that you receive source code or can get it if you
can be used for any textual work, regardless of subject matter or want it, that you can change the software or use pieces of it in new
whether it is published as a printed book. We recommend this License free programs, and that you know you can do these things.
principally for works whose purpose is instruction or reference.
#### 1. APPLICABILITY AND DEFINITIONS To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you
have certain responsibilities if you distribute copies of the
software, or if you modify it: responsibilities to respect the freedom
of others.
This License applies to any manual or other work, in any medium, that For example, if you distribute copies of such a program, whether
contains a notice placed by the copyright holder saying it can be gratis or for a fee, you must pass on to the recipients the same
distributed under the terms of this License. Such a notice grants a freedoms that you received. You must make sure that they, too, receive
world-wide, royalty-free license, unlimited in duration, to use that or can get the source code. And you must show them these terms so they
work under the conditions stated herein. The "Document", below, refers know their rights.
to any such manual or work. Any member of the public is a licensee,
and is addressed as "you". You accept the license if you copy, modify
or distribute the work in a way requiring permission under copyright
law.
A "Modified Version" of the Document means any work containing the Developers that use the GNU GPL protect your rights with two steps:
Document or a portion of it, either copied verbatim, or with (1) assert copyright on the software, and (2) offer you this License
modifications and/or translated into another language. giving you legal permission to copy, distribute and/or modify it.
A "Secondary Section" is a named appendix or a front-matter section of For the developers' and authors' protection, the GPL clearly explains
the Document that deals exclusively with the relationship of the that there is no warranty for this free software. For both users' and
publishers or authors of the Document to the Document's overall authors' sake, the GPL requires that modified versions be marked as
subject (or to related matters) and contains nothing that could fall changed, so that their problems will not be attributed erroneously to
directly within that overall subject. (Thus, if the Document is in authors of previous versions.
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The "Invariant Sections" are certain Secondary Sections whose titles Some devices are designed to deny users access to install or run
are designated, as being those of Invariant Sections, in the notice modified versions of the software inside them, although the
that says that the Document is released under this License. If a manufacturer can do so. This is fundamentally incompatible with the
section does not fit the above definition of Secondary then it is not aim of protecting users' freedom to change the software. The
allowed to be designated as Invariant. The Document may contain zero systematic pattern of such abuse occurs in the area of products for
Invariant Sections. If the Document does not identify any Invariant individuals to use, which is precisely where it is most unacceptable.
Sections then there are none. Therefore, we have designed this version of the GPL to prohibit the
practice for those products. If such problems arise substantially in
other domains, we stand ready to extend this provision to those
domains in future versions of the GPL, as needed to protect the
freedom of users.
The "Cover Texts" are certain short passages of text that are listed, Finally, every program is threatened constantly by software patents.
as Front-Cover Texts or Back-Cover Texts, in the notice that says that States should not allow patents to restrict development and use of
the Document is released under this License. A Front-Cover Text may be software on general-purpose computers, but in those that do, we wish
at most 5 words, and a Back-Cover Text may be at most 25 words. to avoid the special danger that patents applied to a free program
could make it effectively proprietary. To prevent this, the GPL
assures that patents cannot be used to render the program non-free.
A "Transparent" copy of the Document means a machine-readable copy, The precise terms and conditions for copying, distribution and
represented in a format whose specification is available to the modification follow.
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain ### TERMS AND CONDITIONS
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself, #### 0. Definitions.
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
The "publisher" means any person or entity that distributes copies of "This License" refers to version 3 of the GNU General Public License.
the Document to the public.
A section "Entitled XYZ" means a named subunit of the Document whose "Copyright" also means copyright-like laws that apply to other kinds
title either is precisely XYZ or contains XYZ in parentheses following of works, such as semiconductor masks.
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which "The Program" refers to any copyrightable work licensed under this
states that this License applies to the Document. These Warranty License. Each licensee is addressed as "you". "Licensees" and
Disclaimers are considered to be included by reference in this "recipients" may be individuals or organizations.
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
#### 2. VERBATIM COPYING To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of
an exact copy. The resulting work is called a "modified version" of
the earlier work or a work "based on" the earlier work.
You may copy and distribute the Document in any medium, either A "covered work" means either the unmodified Program or a work based
commercially or noncommercially, provided that this License, the on the Program.
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no
other conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and To "propagate" a work means to do anything with it that, without
you may publicly display copies. permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
#### 3. COPYING IN QUANTITY To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user
through a computer network, with no transfer of a copy, is not
conveying.
If you publish printed copies (or copies in media that commonly have An interactive user interface displays "Appropriate Legal Notices" to
printed covers) of the Document, numbering more than 100, and the the extent that it includes a convenient and prominently visible
Document's license notice requires Cover Texts, you must enclose the feature that (1) displays an appropriate copyright notice, and (2)
copies in covers that carry, clearly and legibly, all these Cover tells the user that there is no warranty for the work (except to the
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on extent that warranties are provided), that licensees may convey the
the back cover. Both covers must also clearly and legibly identify you work under this License, and how to view a copy of this License. If
as the publisher of these copies. The front cover must present the the interface presents a list of user commands or options, such as a
full title with all words of the title equally prominent and visible. menu, a prominent item in the list meets this criterion.
You may add other material on the covers in addition. Copying with
changes limited to the covers, as long as they preserve the title of
the Document and satisfy these conditions, can be treated as verbatim
copying in other respects.
If the required texts for either cover are too voluminous to fit #### 1. Source Code.
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering The "source code" for a work means the preferred form of the work for
more than 100, you must either include a machine-readable Transparent making modifications to it. "Object code" means any non-source form of
copy along with each Opaque copy, or state in or with each Opaque copy a work.
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the A "Standard Interface" means an interface that either is an official
Document well before redistributing any large number of copies, to standard defined by a recognized standards body, or, in the case of
give them a chance to provide you with an updated version of the interfaces specified for a particular programming language, one that
Document. is widely used among developers working in that language.
#### 4. MODIFICATIONS The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
You may copy and distribute a Modified Version of the Document under The "Corresponding Source" for a work in object code form means all
the conditions of sections 2 and 3 above, provided that you release the source code needed to generate, install, and (for an executable
the Modified Version under precisely this License, with the Modified work) run the object code and to modify the work, including scripts to
Version filling the role of the Document, thus licensing distribution control those activities. However, it does not include the work's
and modification of the Modified Version to whoever possesses a copy System Libraries, or general-purpose tools or generally available free
of it. In addition, you must do these things in the Modified Version: programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
- A. Use in the Title Page (and on the covers, if any) a title The Corresponding Source need not include anything that users can
distinct from that of the Document, and from those of previous regenerate automatically from other parts of the Corresponding Source.
versions (which should, if there were any, be listed in the
History section of the Document). You may use the same title as a
previous version if the original publisher of that version
gives permission.
- B. List on the Title Page, as authors, one or more persons or
entities responsible for authorship of the modifications in the
Modified Version, together with at least five of the principal
authors of the Document (all of its principal authors, if it has
fewer than five), unless they release you from this requirement.
- C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
- D. Preserve all the copyright notices of the Document.
- E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
- F. Include, immediately after the copyright notices, a license
notice giving the public permission to use the Modified Version
under the terms of this License, in the form shown in the
Addendum below.
- G. Preserve in that license notice the full lists of Invariant
Sections and required Cover Texts given in the Document's
license notice.
- H. Include an unaltered copy of this License.
- I. Preserve the section Entitled "History", Preserve its Title,
and add to it an item stating at least the title, year, new
authors, and publisher of the Modified Version as given on the
Title Page. If there is no section Entitled "History" in the
Document, create one stating the title, year, authors, and
publisher of the Document as given on its Title Page, then add an
item describing the Modified Version as stated in the
previous sentence.
- J. Preserve the network location, if any, given in the Document
for public access to a Transparent copy of the Document, and
likewise the network locations given in the Document for previous
versions it was based on. These may be placed in the "History"
section. You may omit a network location for a work that was
published at least four years before the Document itself, or if
the original publisher of the version it refers to
gives permission.
- K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
- L. Preserve all the Invariant Sections of the Document, unaltered
in their text and in their titles. Section numbers or the
equivalent are not considered part of the section titles.
- M. Delete any section Entitled "Endorsements". Such a section may
not be included in the Modified Version.
- N. Do not retitle any existing section to be Entitled
"Endorsements" or to conflict in title with any Invariant Section.
- O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or The Corresponding Source for a work in source code form is that same
appendices that qualify as Secondary Sections and contain no material work.
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains #### 2. Basic Permissions.
nothing but endorsements of your Modified Version by various
parties—for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a All rights granted under this License are granted for the term of
passage of up to 25 words as a Back-Cover Text, to the end of the list copyright on the Program, and are irrevocable provided the stated
of Cover Texts in the Modified Version. Only one passage of conditions are met. This License explicitly affirms your unlimited
Front-Cover Text and one of Back-Cover Text may be added by (or permission to run the unmodified Program. The output from running a
through arrangements made by) any one entity. If the Document already covered work is covered by this License only if the output, given its
includes a cover text for the same cover, previously added by you or content, constitutes a covered work. This License acknowledges your
by arrangement made by the same entity you are acting on behalf of, rights of fair use or other equivalent, as provided by copyright law.
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License You may make, run and propagate covered works that you do not convey,
give permission to use their names for publicity for or to assert or without conditions so long as your license otherwise remains in force.
imply endorsement of any Modified Version. You may convey covered works to others for the sole purpose of having
them make modifications exclusively for you, or provide you with
facilities for running those works, provided that you comply with the
terms of this License in conveying all material for which you do not
control copyright. Those thus making or running the covered works for
you must do so exclusively on your behalf, under your direction and
control, on terms that prohibit them from making any copies of your
copyrighted material outside their relationship with you.
#### 5. COMBINING DOCUMENTS Conveying under any other circumstances is permitted solely under the
conditions stated below. Sublicensing is not allowed; section 10 makes
it unnecessary.
You may combine the Document with other documents released under this #### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and No covered work shall be deemed part of an effective technological
multiple identical Invariant Sections may be replaced with a single measure under any applicable law fulfilling obligations under article
copy. If there are multiple Invariant Sections with the same name but 11 of the WIPO copyright treaty adopted on 20 December 1996, or
different contents, make the title of each such section unique by similar laws prohibiting or restricting circumvention of such
adding at the end of it, in parentheses, the name of the original measures.
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History" When you convey a covered work, you waive any legal power to forbid
in the various original documents, forming one section Entitled circumvention of technological measures to the extent such
"History"; likewise combine any sections Entitled "Acknowledgements", circumvention is effected by exercising rights under this License with
and any sections Entitled "Dedications". You must delete all sections respect to the covered work, and you disclaim any intention to limit
Entitled "Endorsements". operation or modification of the work as a means of enforcing, against
the work's users, your or third parties' legal rights to forbid
circumvention of technological measures.
#### 6. COLLECTIONS OF DOCUMENTS #### 4. Conveying Verbatim Copies.
You may make a collection consisting of the Document and other You may convey verbatim copies of the Program's source code as you
documents released under this License, and replace the individual receive it, in any medium, provided that you conspicuously and
copies of this License in the various documents with a single copy appropriately publish on each copy an appropriate copyright notice;
that is included in the collection, provided that you follow the rules keep intact all notices stating that this License and any
of this License for verbatim copying of each of the documents in all non-permissive terms added in accord with section 7 apply to the code;
other respects. keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may extract a single document from such a collection, and You may charge any price or no price for each copy that you convey,
distribute it individually under this License, provided you insert a and you may offer support or warranty protection for a fee.
copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that
document.
#### 7. AGGREGATION WITH INDEPENDENT WORKS #### 5. Conveying Modified Source Versions.
A compilation of the Document or its derivatives with other separate You may convey a work based on the Program, or the modifications to
and independent documents or works, in or on a volume of a storage or produce it from the Program, in the form of source code under the
distribution medium, is called an "aggregate" if the copyright terms of section 4, provided that you also meet all of these
resulting from the compilation is not used to limit the legal rights conditions:
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these - a) The work must carry prominent notices stating that you modified
copies of the Document, then if the Document is less than one half of it, and giving a relevant date.
the entire aggregate, the Document's Cover Texts may be placed on - b) The work must carry prominent notices stating that it is
covers that bracket the Document within the aggregate, or the released under this License and any conditions added under
electronic equivalent of covers if the Document is in electronic form. section 7. This requirement modifies the requirement in section 4
Otherwise they must appear on printed covers that bracket the whole to "keep intact all notices".
aggregate. - c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
- d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
#### 8. TRANSLATION A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
Translation is considered a kind of modification, so you may #### 6. Conveying Non-Source Forms.
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements", You may convey a covered work in object code form under the terms of
"Dedications", or "History", the requirement (section 4) to Preserve sections 4 and 5, provided that you also convey the machine-readable
its Title (section 1) will typically require changing the actual Corresponding Source under the terms of this License, in one of these
title. ways:
#### 9. TERMINATION - a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
- b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the Corresponding
Source from a network server at no charge.
- c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
- d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
- e) Convey the object code using peer-to-peer transmission,
provided you inform other peers where the object code and
Corresponding Source of the work are being offered to the general
public at no charge under subsection 6d.
You may not copy, modify, sublicense, or distribute the Document A separable portion of the object code, whose source code is excluded
except as expressly provided under this License. Any attempt otherwise from the Corresponding Source as a System Library, need not be
to copy, modify, sublicense, or distribute it is void, and will included in conveying the object code work.
automatically terminate your rights under this License.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal,
family, or household purposes, or (2) anything designed or sold for
incorporation into a dwelling. In determining whether a product is a
consumer product, doubtful cases shall be resolved in favor of
coverage. For a particular product received by a particular user,
"normally used" refers to a typical or common use of that class of
product, regardless of the status of the particular user or of the way
in which the particular user actually uses, or expects or is expected
to use, the product. A product is a consumer product regardless of
whether the product has substantial commercial, industrial or
non-consumer uses, unless such uses represent the only significant
mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to
install and execute modified versions of a covered work in that User
Product from a modified version of its Corresponding Source. The
information must suffice to ensure that the continued functioning of
the modified object code is in no case prevented or interfered with
solely because modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or
updates for a work that has been modified or installed by the
recipient, or for the User Product in which it has been modified or
installed. Access to a network may be denied when the modification
itself materially and adversely affects the operation of the network
or violates the rules and protocols for communication across the
network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
#### 7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders
of that material) supplement the terms of this License with terms:
- a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
- b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
- c) Prohibiting misrepresentation of the origin of that material,
or requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
- d) Limiting the use for publicity purposes of names of licensors
or authors of the material; or
- e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
- f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions
of it) with contractual assumptions of liability to the recipient,
for any liability that these contractual assumptions directly
impose on those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions; the
above requirements apply either way.
#### 8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your license However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally, from a particular copyright holder is reinstated (a) provisionally,
@ -364,82 +425,193 @@ your receipt of the notice.
Termination of your rights under this section does not terminate the Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently this License. If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does reinstated, you do not qualify to receive new licenses for the same
not give you any rights to use it. material under section 10.
#### 10. FUTURE REVISIONS OF THIS LICENSE #### 9. Acceptance Not Required for Having Copies.
The Free Software Foundation may publish new, revised versions of the You are not required to accept this License in order to receive or run
GNU Free Documentation License from time to time. Such new versions a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
#### 10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
#### 11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned
or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within the
scope of its coverage, prohibits the exercise of, or is conditioned on
the non-exercise of one or more of the rights that are specifically
granted under this License. You may not convey a covered work if you
are a party to an arrangement with a third party that is in the
business of distributing software, under which you make payment to the
third party based on the extent of your activity of conveying the
work, and under which the third party grants, to any of the parties
who would receive the covered work from you, a discriminatory patent
license (a) in connection with copies of the covered work conveyed by
you (or copies made from those copies), or (b) primarily for and in
connection with specific products or compilations that contain the
covered work, unless you entered into that arrangement, or that patent
license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
#### 12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under
this License and any other pertinent obligations, then as a
consequence you may not convey it at all. For example, if you agree to
terms that obligate you to collect a royalty for further conveying
from those to whom you convey the Program, the only way you could
satisfy both those terms and this License would be to refrain entirely
from conveying the Program.
#### 13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
#### 14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions
of the GNU General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in will be similar in spirit to the present version, but may differ in
detail to address new problems or concerns. See detail to address new problems or concerns.
<https://www.gnu.org/licenses/>.
Each version of the License is given a distinguishing version number. Each version is given a distinguishing version number. If the Program
If the Document specifies that a particular numbered version of this specifies that a certain numbered version of the GNU General Public
License "or any later version" applies to it, you have the option of License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or following the terms and conditions either of that numbered version or
of any later version that has been published (not as a draft) by the of any later version published by the Free Software Foundation. If the
Free Software Foundation. If the Document does not specify a version Program does not specify a version number of the GNU General Public
number of this License, you may choose any version ever published (not License, you may choose any version ever published by the Free
as a draft) by the Free Software Foundation. If the Document specifies Software Foundation.
that a proxy can decide which future versions of this License can be
used, that proxy's public statement of acceptance of a version
permanently authorizes you to choose that version for the Document.
#### 11. RELICENSING If the Program specifies that a proxy can decide which future versions
of the GNU General Public License can be used, that proxy's public
statement of acceptance of a version permanently authorizes you to
choose that version for the Program.
"Massive Multiauthor Collaboration Site" (or "MMC Site") means any Later license versions may give you additional or different
World Wide Web server that publishes copyrightable works and also permissions. However, no additional obligations are imposed on any
provides prominent facilities for anybody to edit those works. A author or copyright holder as a result of your choosing to follow a
public wiki that anybody can edit is an example of such a server. A later version.
"Massive Multiauthor Collaboration" (or "MMC") contained in the site
means any set of copyrightable works thus published on the MMC site.
"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 #### 15. Disclaimer of Warranty.
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
"Incorporate" means to publish or republish a Document, in whole or in THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
part, as part of another Document. APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
An MMC is "eligible for relicensing" if it is licensed under this #### 16. Limitation of Liability.
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole
or in part into the MMC, (1) had no cover texts or invariant sections,
and (2) were thus incorporated prior to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the site IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
under CC-BY-SA on the same site at any time before August 1, 2009, WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
provided the MMC is eligible for relicensing. CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
### ADDENDUM: How to use this License for your documents #### 17. Interpretation of Sections 15 and 16.
To use this License in a document you have written, include a copy of If the disclaimer of warranty and limitation of liability provided
the License in the document and put the following copyright and above cannot be given local legal effect according to their terms,
license notices just after the title page: reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Copyright (C) YEAR YOUR NAME. Program, unless a warranty or assumption of liability accompanies a
Permission is granted to copy, distribute and/or modify this document copy of the Program in return for a fee.
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
If you have Invariant Sections, Front-Cover Texts and Back-Cover
Texts, replace the "with … Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License, to
permit their use in free software.

View File

@ -1,26 +1,7 @@
# Eifueo # Eifueo
A "competitor" of sorts to magicalsoup/highschool available at https://eifueo.eggworld.tk. A "competitor" of sorts to magicalsoup/highschool.
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines and formatting information. The LaTeX formatting in this repository uses `$...$` for inline math, and `$$...$$` for multi-line math. MathJax is used to render this LaTeX.
## Dependencies Admonitions can be added with documentation available [here](https://squidfunk.github.io/mkdocs-material/reference/admonitions/#usage).
- `mkdocs`
- `mkdocs-material`
- `mkdocs-material-extensions`
- `python-markdown-math`
## Build instructions
MkDocs is used to build the site.
```
mkdocs build
```
For live reload in a development environment:
```
mkdocs serve
```

View File

@ -1,246 +0,0 @@
# ECE 105: Classical Mechanics
## Motion
Please see [SL Physics 1#2.1 - Motion](/g11/sph3u7/#21-motion) for more information.
## Kinematics
Please see [SL Physics 1#Kinematic equations](/g11/sph3u7/#kinematic-equations) for more information.
## Projectile motion
Please see [SL Physics 1#Projectile motion](/g11/sph3u7/#projectile-motion) for more information.
## Uniform circular motion
Please see [SL Physics 1#6.1 - Circular motion](/g11/sph3u7/#61-circular-motion) for more information.
## Forces
Please see [SL Physics 1#2.2 - Forces](/g11/sph3u7/#22-forces) for more information.
## Work
Please see [SL Physics 1#2.3 - Work, energy, and power](/g11/sph3u7/#23-work-energy-and-power) for more information.
## Momentum and impulse
Please see [SL Physics 1#2.4 - Momentum and impulse](/g11/sph3u7/#24-momentum-and-impulse) for more information.
The change of momentum with respect to time is equal to the average force **so long as mass is constant**.
$$\frac{dp}{dt} = \frac{mdv}{dt} + \frac{vdm}{dt}$$
Impulse is actually the change of momentum over time.
$$\vec J = \int^{p_f}_{p_i}d\vec p$$
## Centre of mass
The centre of mass $x$ of a system is equal to the average of the centre of masses of its components relative to a defined origin.
$$x_{cm} = \frac{m_1x_1 + m_2x_2 + ... + m_nx_n}{m_1 + m_2 + ... + m_n}$$
To determine the centre of mass of a system with a hole, the hole should be treated as negative mass. If the geometry of the system is **symmetrical**, the centre of mass is also symmetrical in the x and y dimensions.
For each mass, its surface density $\sigma$ is equal to:
$$
\sigma = \frac{m}{A} \\
m = \sigma A
$$
Holes have negative mass, i.e., $m = -\sigma A$.
For a **one-dimensional** hole, the linear mass density uses a similar formula:
$$
\lambda =\frac{m}{L} \\
\lambda = \frac{dm}{dx}
$$
This means that a hole in a rod can use a different formula:
$$x_{cm} = \frac{1}{M}\int^M_0 x\cdot dm$$
For a solid object, the centre of mass can be expressed as a Riemann sum and thus an integral:
$$r_{cm} = \frac{1}{M}\int_0^M r\cdot dm$$
In an **isolated system**, it is guaranteed that the centre of mass of the whole system never changes so long as only rigid bodies are involved.
## Rotational motion
### Moment of inertia
The moment of inertia of an object represents its ability to resist rotation, effectively the rotational equivalent of mass. It is equal to the sum of each point and distance from the axis of rotation.
$$I=\sum(mr)^2$$
For more complex objects where the distance often changes:
$$I=\int^M_0 R^2 dm$$
#### Common moment shapes
- Solid cylinder or disc symmetrical to axis: $I = \frac{1}{2}MR^2$
- Hoop about symmetrical axis: $I=MR^2$
- Solid sphere: $\frac{2}{5}MR^2$
- Thin spherical shell: $I=\frac{2}{3}MR^2$
- Solid cylinder about the central diameter: $I=\frac{1}{4}MR^2 + \frac{1}{12}ML^2$
- Hoop about diameter: $I=\frac{1}{2}MR^2$
- Rod about center: $I=\frac{1}{12}ML^2$
- Rod about end: $I=\frac{1}{3}ML^2$
- Thin rectangular plate about perpendicular axis through center: $I=\frac{1}{3}ML^2$
### Rotational-translational equivalence
Most translational variables have a rotational equivalent.
Although the below should be represented as cross products, this course only deals with rotation perpendicular to the axis, so the following are always true.
Angular acceleration is related to acceleration:
$$\alpha = \frac{a}{r}$$
Angular velocity is related to velocity:
$$\omega = \frac{v}{r}$$
The direction of the tangential values can be determined via the right hand rule. Where $r$ is the vector from the **origin to the mass**:
$$
\vec v = r\times\omega \\
\vec a = r\times\alpha
$$
And all kinematic equations have their rotational equivalents.
- $\theta = \frac{1}{2}(\omega_f + \omega_i)t$
- $\omega_f = \omega_i + \alpha t$
- $\theta = \omega_i t + \frac{1}{2}\alpha t^2$
- $\omega_f^2 + \omega_i^2 + 2\alpha\theta$
Most translational equations also have rotational equivalents.
$$E_\text{k rot} = \frac{1}{2}I\omega^2$$
## Torque
Torque is the rotational equivalent of force.
$$\vec\tau=I\vec\alpha$$
$$\vec\tau=\vec r\times\vec F$$
$$|\vec\tau=|r||F|\sin\theta$$
In the general case, especially when the force is variable, the work done is equal to the integral of force over displacement.
$$W=\int^{x_f}_{x_i}F_xdx$$
Work is also related to torque:
$$W=\tau\Delta\theta$$
$$W=F\Delta S$$
The total net work from torque from external forces is equivalent to:
$$W=\Delta E_k = \int^{\theta_f}_{\theta_i}\tau d\theta$$
### Angular momentum
This is the same as linear momentum.
$$\vec L = \vec r\times\vec p$$
$$\vec L = I\vec\omega$$
$$\vec L =\vec\tau t$$
## Rolling motion
!!! definition
- **Slipping** is sliding faster than spinning.
- **Skidding** is spinning faster than sliding.
Pure rolling motion is **only true if** the tangential velocity of the centre of mass is equal to its rotational velocity.
$$v_{cm}=R\omega$$
In pure rolling motion, the point at the top is moving at two times the velocity while the point at the bottom has no tangential velocity.
<img src="https://upload.wikimedia.org/wikipedia/commons/8/8d/Velocitats_Roda.svg" width=500>(Source: Wikimedia Commons)</img>
For any point in the mass:
$$
v_{net} = v_{trans} + v_{rot} \\
v_{net} = v_{cm} + \vec R \times\vec\omega \\
E_{k roll} = E_{k trans} + E_{k rot}
$$
Alternatively, the rolling can be considered as a rotation about the pivot point between the disk and the ground, allowing rolling motion to be represented as rotational motion around the pivot point. The **parallel axis theorem** can be used to return it back to the original point.
$$\sum\tau_b=I_b\alpha$$
At least one external torque and one external force is required to initiate pure rolling motion because the two components are separate.
If an object is purely rolling and then it moves to:
- a flat, frictionless surface, it continues purely rolling
- an inclined, frictionless surface, external torque is needed to maintain pure rolling motion
- an inclined surface with friction, it continues purely rolling
Where $c$ is the coefficient to the moment of inertia ($I=cMR^2$), while rolling down an incline:
$$
v_{cm} = \sqrt{\frac{2}{1+c}gh} \\
a_{cm} = \frac{g\sin\theta}{1+c}
$$
## Statics
An object at **static equilibrium** has no rotational or translational velocity with zero net force and torque.
An object at **dynamic equilibrium** has a constant rotational and translational velocity with zero net force and torque.
$$
\sum\vec F = 0 \\
\sum\vec\tau = 0
$$
Whether an object *stays* at static equilibrium depends on the
- It is at **unstable equilibrium** if the object moves away and does not return to equilibrium
- It is at **stable equilibrium** if the object returns to its original position and equilibrium
- It is **neutral** if the object does not move
## Simple harmonic motion
!!! definition
- The **amplitude** $A$ of a wave is always greater than zero and is equal to the height of the wave above the axis.
- The **angular frequency** $\omega$ is the angular velocity, which is dependent only on the restorative force.
- The **phase constant** $\phi$ is the offset from equilibrium at $t=0$.
Please see [SL Physics 1#Simple harmonic motion](/g11/sph3u7/#simple-harmonic-motion) for more information.
The position of any periodic motion can be represented as a sine or cosine function (adjust phase as needed).
$$x(t)=A\cos(\omega t+\phi)$$
This means that the velocity function has a phase shift of $\frac{\pi}{2}$ and the acceleration function has a phase shift of $\pi$ along with other changes.
SHM is linked to uniform circular motion:
- $\phi$ is the angle from the standard axis
- $A$ is the radius
The restorative force can be modelled by substituting in $a(t)$ into $F=ma$
$$F=-m\omega^2x(t)$$
Because restoring force is proportional to the negative position for **smaller displacements**, $F=-Cx(t)$.
Torque is also linear: $\tau=-k\theta$
!!! warning
For small angles, $\sin\theta = \theta$.
$$\omega=\sqrt{\frac{C}{m}}$$

View File

@ -1,654 +0,0 @@
# ECE 150: C++
## Non-decimal numbers
Binary numbers are prefixed with `0b`.
!!! example
The following two snippets are equivalent:
```cpp
int a{0b110001};
```
```cpp
int a{25};
```
To convert from **binary to decimal**, each digit should be treated as a power of two much like in the base 10 system.
!!! example
$$0
\text{0b1011}=1\times2^3 + 0\times2^2+1\times2^1+1\times2^0=11
$$
Binary addition is the same as decimal addition except $1+1=10$ and $1+1+1=11$.
To convert from **decimal to binary**, the number should be repeatedly divided by 2 and the binary number taken from the remainders from bottom to top.
!!! example
$$
\begin{align*}
13 &= 2\times6 + 1 \\
6 &= 2\times3 + 0 \\
3 &= 2\times1 + 1 \\
1 &= 2\times0 + 1
\\
&\therefore 13 = \text{0b1101}
\end{align*}
$$
To convert from **binary to hexadecimal**, each group of four digits beginning from the right should be converted to their hexadecimal representation.
To convert from **hexadecimal to binary**, each hexadecimal digit should be expanded into its four-digit binary representation.
To convert from **decimal to hexadecimal**, the number should be repeatedly divided by 16 and the hex number taken from the remainders from bottom to top.
!!! example
$$
\begin{align*}
37 &= 16\times2 + 5 \\
2 &= 16\times0 + 2
\\
&\therefore 37 = \text{0x25}
\end{align*}
$$
## Numbers
### Integers
!!! definition
- A **carry** occurs if an overflow or underflow happens in an unsigned number.
The $k$th bit of a number is as known as its **coefficient** because it can be expressed in the form $n\times 2^k$ in binary or $n\times 16^k$ in hexadecimal.
| Type | Bits | Can store |
| --- | --- | --- |
| `short` | 16 | $\pm2^{15}-1$ |
| `int` | 32 | $\pm2^{31}-1$ |
| `long` | 64 | $\pm2^{63}-1$ |
| `char` | 8 | N/A |
| `unsigned short` | 16 | $2^{16}-1$ |
| `unsigned int` | 32 | $2^{32}-1$ |
| `unsigned long` | 64 | $2^{64}-1$ |
| `unsigned char` | 8 | N/A |
The `sizeof()` operator evaluates the size the type takes in memory at compile time.
Signed numbers use the first bit to represent positive or negative numbers. A negative number is equal to the **two's complement** of its positive form. This allows subtraction to be done by taking the two's complement of the subtracter.
!!! definition
The two's complement form of a number flips all bits **but the rightmost digit equal to one**.
### Floating point numbers
| Type | Bits | Digits of precision |
| --- | --- | --- |
| `float` | 32 | ~7 |
| `double` | 64 | ~16 |
Floating point numbers let a computer work with numbers of arbitrary precision. However, the limited digits of precision mean that a small number added to a large number can result in the number not changing. This results in odd scenarios such as:
$$
x+(y+z)\neq(x+y)+z
$$
## References
The ampersand (&) represents a reference variable and an argument passed into a parameter with an ampersand must be a valid lvalue.
Effectively, it is a pointer, letting you do weird shit such as:
```cpp
void inc(int &n) {
n++;
}
```
where the variable passed into `inc` will actually increase in the caller function.
This can also be used in variable declarations to not create a second local variable:
```cpp
#include <climits>
double const &pi{M_PI}; // pi links back to M_PI
```
## Arrays
```cpp
// typename identifier[n]{};
int array[5]{};
int partial[3]{2};
int filled[3]{1, 2, 3};
```
Arrays are contiguous in memory and default to 0 when initialised. If field initialised with values, the array will fill the first values as those values and set the rest to 0.
Because arrays do not check bounds, `array[n+10]` or `array[-5]` will go to the memory address directed without complaint and ruin your day.
| Pros | Cons |
| --- | --- |
| Random access is $O(1)$ | $O(n)$ push front |
| | Fixed size and unused allocated memory |
| | Concatenation is slow |
### Local arrays
Local arrays cannot be assigned to nor returned from a function. If an array is marked `const`, its entries cannot be modified.
Arrays can be passed to functions by reference (via pointer to the first entry).
## Memory
!!! definition
- **Volatile** memory is erased after the memory is powered off.
- **Byte-addressable** memory is memory that has an address for each byte, such that to change a single bit the whole byte must be rewritten.
Main memory (random access memory, RAM) is volatile and any location in the memory has the same access speed.
An **address bus** with $n$ lines allows the CPU to update $n/8$ bytes at once (one address bit per line). The number of total memory addresses is limited by the number of lanes in the address bus.
When a program is run, the operating system (OS) allocates a block of memory for it such that the largest address is at the bottom of the memory block for the program.
- Instructions (the **code segment**) are stored at the **top** of the block
- Constants (the **data segment**, including string literals) are stored **after** the instructions
- Local variables (the **call stack**) are stored beginning from the **bottom** of the block
Dynamically allocated variables and static variables are stored between the call stack and the data segment.
### Call stack
The call stack represents memory and variables are allocated space from bottom to top.
At the moment a function is run, its parameters are allocated space at the bottom, followed by all local variables that **may or may not** be defined.
The return value of the function overwrites whatever is at the bottom of the function-allocated block such that the caller can simply reach up to get return data.
!!! warning
Arrays are allocated **top-down** such that indexing is made easy.
## C-style strings
C-style strings are char arrays that end with a **null terminator** (`\0`). By default, char arrays are initialised with this character.
If there is not a null terminator, attempting to access a string continues to go down the call stack until a zero byte is found.
## Dynamic allocation
Compared to static memory allocation, which is done by the compiler, dynamic memory is managed by the developer, and is stored between the call stack and data segment in the **heap**.
The `new` operator attempts to allocate its type operand, optionally initialising the variable and returning its memory address.
```cpp
char *c{new char{'i'}};
```
If the operating system cannot allocate that much memory, `std::bad_alloc` is raised, but passing in `nothrow` can return a `nullptr` instead if allocation fails.
```cpp
char *c{new(nothrow) char{`i`}};
if (c == nullptr) {
}
```
The `delete` operator tells the OS that the memory address passed is no longer needed. Generally, it is a good idea to set the deleted pointer afterward to a null pointer.
```cpp
delete c;
c = nullptr;
```
If deleting arrays, `delete[]` should be used instead.
!!! warning
Statically allocated memory **cannot be deallocated** manually as it is done so by the compiler, so differentiating the two is generally a good idea.
### Vectors at home
Dynamic allocation can be used to mimick an `std::vector` by creating a new array whenever an element would be full and doubling its size, copying all elements over.
!!! example
Sample implementation:
```cpp
std::size_t capacity{10};
double *data{new double[capacity]};
std::size_t els{0};
while (true) {
double x{};
std::cin >> x;
++els;
if (els == capacity) {
std::size_t old_capacity{capacity};
double *old_data{data};
capacity *= 2;
data = new double[capacity];
for (int i{}; i < old_capacity; ++i) {
data[i] = old_data[i];
}
delete[] old_data;
old_data = nullptr;
}
}
```
### Wild pointers
A wild pointer is any uninitialised pointer. Its behaviour is undefined. Accessing unallocated memory results in a **segmentation fault**, causing the OS to terminate the program.
!!! warning
Occasionally, the OS does not prevent program access to deallocated memory for some time, which may allow the program to reuse garbage pointers, allowing the pointer to work. This causes inconsistent crashing.
To avoid wild pointers, pointers should always be initialised and set to `nullptr` if not needed even if they would go out of scope.
### Dangling pointers
A dangling pointer is one that has been deallocated, which has the same issues as a wild pointer, especially if two pointers have the same address.
!!! example
`p_2` is dangling.
```cpp
int* p_1{};
int* p_2{p_1};
delete p_1;
```
To avoid dangling pointers, pointers should be immediately set to `nullptr` after deleting them. Deleting a `nullptr` is **guaranteed to be safe**.
### Memory leaks
A memory leak occurs when a pointer is not freed, such as via an early return or setting a pointer to another pointer. This causes memory usage to grow until the program is terminated.
!!! example
The `new int[20]` has leaked and is no longer accessible to the program but remains allocated memory.
```cpp
int* p{new int[20]};
p = new int[10];
```
## Pointers
!!! definition
- A **pointer** is a variable that stores a memory address.
The asterisk `*` indicates that the variable is a pointer address and can be **dereferenced**. `&` can convert an identifier to a pointer.
```cpp
int array[10];
int *p_array{array};
int num{2};
int *p_num{&num};
```
!!! warning
Only **addresses** should be passed when assigning pointer variables — this means that primitive types must be converted first to a reference with `&`.
The default size of a pointer (the address size) can be found by taking the `sizeof` of any pointer.
```cpp
sizeof(int*);`
```
The memory at the location of the pointer can be accessed by setting the pointer as the lvalue:
```cpp
*var = 100;
```
The `const` modifier only makes constant the value immediately after `const`, meaning that the expression after it cannot be used as an lvalue.
!!! example
```cpp
int* const p_x{&x};
p_x = &y; // not allowed
*p_x = y; // allowed
```
```cpp
int const *p_x{&x};
p_x = &y; // allowed
*p_x = y; // not allowed
```
```cpp
int const * const p_x{&x};
p_x = &y; // not allowed
*p_x = y; // not allowed
```
Pointers to `const` values must also be `const`.
!!! example
BAD:
```cpp
const int x = 2;
int *p_x{&x};
```
GOOD:
```cpp
const int x = 2;
int const *p_x{&x};
```
## Sorting algorithms
### Selection sort
Selection sort takes the largest item in the array each time and adds it to the end.
```rust
fn selection_sort(array: &mut [i32]) {
for i in (0..array.len()).rev() {
let mut max_index = 0;
for j in 0..i + 1 {
if array[j] > array[max_index] {
max_index = j;
}
}
let _ = &array.swap(i, max_index);
}
}
```
### Insertion sort
Insertion sort assumes the first element of the array is sorted and expands that partition by moving each element afterward to the correct spot.
```rust
fn insertion_sort(array: &mut [i32]) {
for i in 1..array.len() {
let mut temp = array[0];
for j in 0..i {
if array[j] < array[i] {
temp = array[i];
for k in (j..i).rev() {
array[k + 1] = array[k]
}
array[j] = temp;
break;
}
}
}
}
```
## Recursion
### Merge sort
Merge sort is a recursive sorting algorithm with the following pseudocode:
- If the array length is one or less, do not modify the array
- Otherwise, split the array into two halves and call merge sort on both halves
- Merge the split arrays together in sorted order (adding each in sequence such that it is sorted)
```cpp
void merge_sort( double array[], std::size_t capacity ) {
if ( capacity <= 1 ) {
return;
} else {
std::size_t capacity_1{ capacity/2 };
std::size_t capacity_2{ capacity - capacity_1 };
merge_sort( array, capacity_1 );
merge_sort( array + capacity_1, capacity_2 );
merge( array, capacity_1, capacity_2 );
}
}
void merge( double array[], std::size_t cap_1,
std::size_t cap_2 ) {
double tmp_array[cap_1 + cap_2];
std::size_t k1{0};
std::size_t k2{cap_1};
std::size_t kt{0};
// As long as not everything in each half is not
// copied over, copy the next smallest entry into the
// temporary array.
while ( (k1 < cap_1) && (k2 < cap_1 + cap_2 ) ) {
if ( array[k1] <= array[k2] ) {
tmp_array[kt] = array[k1];
++k1;
} else {
tmp_array[kt] = array[k2];
++k2;
}
++kt;
}
// Copy all entries left from the left half (if any)
// to the temporary array.
while ( k1 < cap_1 ) {
tmp_array[kt] = array[k1];
++k1;
++kt;
}
// Copy all entries left from the right half (if any)
// to the temporary array.
while ( k2 < cap_1 + cap_2 ) {
tmp_array[kt] = array[k2];
++k2;
++kt;
}
// Copy all the entries back to the original array.
for ( std::size_t k{0}; k < (cap_1 + cap_2); ++k ) {
array[k] = tmp_array[k];
}
}
```
## Classes
By convention, class member variables are suffixed with an underscore.
Classes inherently have two default constructors — one if passed another version of itself and one if the user does not define one, using the list of `public` variables.
!!! example
the following initialisers both do the same thing — they both copy `earth` into a new variable (not by reference).
```cpp
Body earth{};
Body tmp{earth};
Body tmp2 = earth;
```
### Namespaces
Namespaces allow definitions to be scoped, such as `std`.
```cpp
namespace eggy {
std::string name{"eggy"};
std::string get_name() {
return eggy::name;
}
}
```
Namespaces can also be nested within namespaces.
!!! warning
`std::cout` does weird shenanigans that passes itself to every function afterward, such as `std::endl`.
This means that `std::cout << std::endl;` is equivalent to `std::endl(std::cout);`.
### Operator overloading
Operators can be overloaded for various classes.
!!! example
Overloading for displaying to `cout`:
```cpp
std::ostream operator<<(std::ostream &out, ClassName const &p) {
out << "text here";
return out;
}
### Constructors
Constructors can be defined with default values after a colon and before the function body:
```cpp
Rational::Rational():
numer_{0},
denom_{0} {
}
```
Subsequent members can even use the values of previous ones.
Constructors can also contain parameters with default values, but default values must also be present in the class declaration.
### Member functions
A `const` after a member function forbids the modification of any member variables within that function.
```cpp
int get_val() const {
}
```
## Exceptions
`#define NDEBUG` turns off assertions.
`static_cast<double>(var)` performs the typical implicit conversion explicitly during compile time.
Exceptions are expensive error handlers that **do not protect** from program termination (e.g., attempt to access invalid memory).
The following are all exception classes in `std`:
- `domain_error`
- `runtime_error`
- `range_error`
- `overflow_error`
- `underflow_error`
- `logic_error`
- `length_error`
- `out_of_range`
`...` is a catch-all exception.
!!! example
```cpp
try {
throw std::domain_error{"cannot compute stupidity"};
} catch (std::domain_error &e) {
std::cerr << e->what();
} catch (...) {
}
```
## Copies and moves
The copy constructor by default copies **the value** of every public and private field, including pointers, both from field initialisation or assignment.
```cpp
MyClass n{};
MyClass m{n}; // copy
MyClass p = n; // copy
```
The move constructor copies every field from the other object and resets the original object to no longer point to that data, typically called only via `std::move`.
```cpp
MyClass a{};
MyClass b{std::move(a)};
```
It is an excellent idea to blank out the two constructors to do nothing so that unexpected behaviour does not occur.
```cpp
class MyClass {
public:
MyClass(MyClass const &rhs) = delete;
MyClass(MyClass &&rhs) = delete;
MyClass &operator=(MyClass const &rhs) = delete;
MyClass &operator=(MyClass &&rhs) = delete;
}
```
If a move occurs and the compiler determines that the original object is no longer needed, its destructor is automatically called immediately after the constructor / assignment finishes.
During construction, default initialisation picks the one with the fewest parameters if ambiguous. Parameters passed by value are **copied** by reference via the copy constructor.
Much like statically allocated arrays, dynamically allocated arrays also automatically dereference when accessed by index.
## Linked lists
Dynamic memory allocation for many objects instead of one like arrays is slow.
## Inheritance
All member functions and the destructor must be `virtual` functions if they can be inherited.
```cpp
class Base {
public:
Base();
virtual ~Base();
virtual Base get_base() const;
virtual void set_base();
virtual void do_base() const;
```
A class that inherits another should contain `public <Base>` after the name of the class. Overriden functions must have `override` if they should have the same type signature. Otherwise, they reference the base function.
```cpp
class ExtendedBase: public Base {
public:
ExtendedBase();
Base get_base() const override;
void set_base() override;
virtual void do_base() override;
}
```
Functions can be overriden completely ignoring the function signature by excluding the `override` keyword.
The base class's functions implicitly refer to the current class, so they can be directly called:
```cpp
void set_base() override {
Base::set_base();
}
```
### protected
The `protected` access keyword only allows the original class as well as classes that extend the original one to access it.
### Extending exceptions
Exceptions should have two constructors: one for a char array pointer and another a string for the exception message, as well as any additional parameters as desired. The base exception constructor (not `std::exception` because that can't be instantiated`) should be called to do all of the base constructor things.
In addition, a `what()` function with the following signature should always be defined that cannot throw an exception, returning a C-style array.
```cpp
char const *error::what() const noexcept;
```

File diff suppressed because it is too large Load Diff

View File

@ -1,754 +0,0 @@
# MATH 117: Calculus 1
## Functions
A **function** is a rule where each input has exactly one output, which can be determined by the **vertical line test**.
!!! definition
- The **domain** is the set of allowable independent values.
- The **range** is the set of allowable dependent values.
Functions can be **composed** to apply the result of one function to another.
$$
(f\circ g)(x) = f(g(x))
$$
!!! warning
Composition is not commutative: $f\circ g \neq g\circ f$.
## Inverse functions
The inverse of a function swaps the domain and range of the original function: $f^{-1}(x)$ is the inverse of $f(x)$.. It can be determined by solving for the other variable:
$$
\begin{align*}
y&=mx+b \\
y-b&=mx \\
x&=\frac{y-b}{m}
\end{align*}
$$
Because the domain and range are simply swapped, the inverse function is just the original function reflected across the line $y=x$.
<img src="https://upload.wikimedia.org/wikipedia/commons/1/11/Inverse_Function_Graph.png" width=300>(Source: Wikimedia Commons, public domain)</img>
If the inverse of a function is applied to the original function, the original value is returned.
$$f^{-1}(f(x)) = x$$
A function is **invertible** only if it is "**one-to-one**": each output must have exactly one input. This can be tested via a horizontal line test of the original function.
If a function is not invertible, restricting the domain may allow a **partial inverse** to be defined.
!!! example
<img src="https://upload.wikimedia.org/wikipedia/commons/7/70/Inverse_square_graph.svg">(Source: Wikimedia Commons, public domain)</img>
By restricting the domain to $[0,\inf]$, the **multivalued inverse function** $y=\pm\sqrt{x}$ is reduced to just the partial inverse $y=\sqrt{x}$.
## Symmetry
An **even function** satisfies the property that $f(x)=f(-x)$, indicating that it is unchanged by a reflection across the y-axis.
An **odd function** satisfies the property that $-f(x)=f(-x)$, indicating that it is unchanged by a 180° rotation about the origin.
The following properties are always true for even and odd functions:
- even × even = even
- odd × odd = even
- even × odd = odd
Functions that are symmetric (that is, both $f(x)$ and $f(-x)$ exist) can be split into an even and odd component. Where $g(x)$ is the even component and $h(x)$ is the odd component:
$$
\begin{align*}
f(x) &= g(x) + h(x) \\
g(x) &= \frac{1}{2}(f(x) + f(-x)) \\
h(x) &= \frac{1}{2}(f(x) - f(-x))
\end{align*}
$$
!!! note
The hyperbolic sine and cosine are the even and odd components of $f(x)=e^x$.
$$
\cosh x = \frac{1}{2}(e^x + e^{-x}) \\
\sinh x = \frac{1}{2}(e^x - e^{-x})
$$
## Piecewise functions
A piecewise function is one that changes formulae at certain intervals. To solve piecewise functions, each of one's intervals should be considered.
### Absolute value function
$$
\begin{align*}
|x| = \begin{cases}
x &\text{ if } x\geq 0 \\
-x &\text{ if } x < 0
\end{cases}
\end{align*}
$$
### Signum function
The signum function returns the sign of its argument.
$$
\begin{align*}
\text{sgn}(x)=\begin{cases}
-1 &\text{ if } x < 0 \\
0 &\text{ if } x = 0 \\
1 &\text{ if } x > 0
\end{cases}
\end{align*}
$$
### Ramp function
The ramp function makes a ramp through the origin that suddenly flatlines at 0. Where $c$ is a constant:
$$
\begin{align*}
r(t)=\begin{cases}
0 &\text{ if } x \leq 0 \\
ct &\text{ if } x > 0
\end{cases}
\end{align*}
$$
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c9/Ramp_function.svg" width=700>(Source: Wikimedia Commons, public domain)</img>
### Floor and ceiling functions
The floor function rounds down.
$$\lfloor x\rfloor$$
The ceiling function rounds up.
$$\lceil x \rceil$$
### Fractional part function
In a nutshell, the fractional part function:
- returns the part **after the decimal point** if the number is positive
- returns 1 - **the part after the decimal point** if the number is negative
$$\text{FRACPT}(x) = x-\lfloor x\rfloor$$
Because this function is periodic, it can be used to limit angles to the $[0, 2\pi)$ range with:
$$f(\theta) = 2\pi\cdot\text{FRACPT}\biggr(\frac{\theta}{2\pi}\biggr)$$
### Heaviside function
The Heaviside function effectively returns a boolean whether the number is greater than 0.
$$
\begin{align*}
H(x) = \begin{cases}
0 &\text{ if } t < 0 \\
1 &\text{ if } t \geq 0
\end{cases}
\end{align*}
$$
This can be used to construct other piecewise functions by enabling them with $H(x-a)$ as a factor, where $a$ is the interval.
In a nutshell:
- $1-H(t-a)$ lets you "turn a function off" at at $t=a$
- $H(t-a)$ lets you "turn a function on at $t=a$
- $H(t-a) - H(t-b)$ leaves a function on in the interval $(a, b)$
!!! example
TODO: example for converting piecewise to heaviside via collecting heavisides
and vice versa
## Periodicity
The function $f(t)$ is periodic only if there is a repeating pattern, i.e. such that for every $x$, there is an $f(x) = f(x + nT)$, where $T$ is the period and $n$ is any integer.
### Circular motion
Please see [SL Physics 1#6.1 - Circular motion](/g11/sph3u7/#61-circular-motion) and its subcategory "Angular thingies" for more information.
## Partial function decomposition (PFD)
In order to PFD:
1. Factor the denominator into *irreducibly* quadratic or linear terms.
2. For each factor, create a term. Where capital letters below are constants:
- A linear factor $Bx+C$ has a term $\frac{A}{Bx+C}$.
- An *irreducibly* quadratic factor $Dx^2+Ex+G$ has a term $\frac{Hx+J}{Dx^2+Ex+G}$.
- Duplicate factors have terms with denominators with that factor to the power of 1 up to the number of times the factor is present in the original.
4. Set the two equal to each other such that the denominators can be factored out.
5. Create systems of equations to solve for each constant.
!!! example
To decompose $\frac{x}{(x+1)(x^2+x+1)}$:
$$
\begin{align*}
\frac{x}{(x+1)(x^2+x+1)} &= \frac{A}{x+1} + \frac{Bx+C}{x^2+x+1} \\
&= \frac{A(x^2+x+1) + (Bx+C)(x+1)}{(x+1)(x^2+x+1)} \\
x &= A(x^2+x+1) + (Bx+C)(x+1) \\
0x^2 + x + 0 &= (Ax^2 + Bx^2) + (Ax + Bx + Cx) + (A + C) \\
\\
&\begin{cases}
0 = A + B \\
1 = A + B + C \\
0 = A + C
\end{cases}
\\
A &= -1 \\
B &= 1 \\
C &= 1 \\
\\
∴ \frac{x}{(x+1)(x^2+x+1)} &= -\frac{1}{x+1} + \frac{x + 1}{x^2 + x + 1}
\end{align*}
$$
## Trigonometry
1 radian represents the angle when the length of the arc of a circle is equal to the radius. Where $s$ is the arc length:
$$\theta=\frac{s}{r}$$
The following table indicates the special angles that should be memorised:
| Angle (rad) | 0 | $\frac{\pi}{6}$ | $\frac{\pi}{4}$ | $\frac{\pi}{3}$ | $\frac{\pi}{2}$ | $\pi$ |
| --- | --- | --- | --- | --- | --- | --- |
| cos | 1 | $\frac{\sqrt{3}}{2}$ | $\frac{\sqrt{2}}{2}$ | $\frac{1}{2}$ | 0 | -1 |
| sin | 0 | $\frac{1}{2}$ | $\frac{\sqrt{2}}{2}$ | $\frac{\sqrt{3}}{2}$ | 1 | 0 |
| tan | 0 | $\frac{\sqrt{3}}{3}$ | 1 | $\sqrt{3}$ | not allowed | 0 |
### Identities
The Pythagorean identity is the one behind right angle triangles:
$$\cos^2\theta+\sin^2\theta = 1$$
Cosine and sine can be converted between by an angle shift:
$$
\cos\biggr(\theta-\frac{\pi}{2}\biggr) = \sin\theta \\
\sin\biggr(\theta-\frac{\pi}{2}\biggr) = \cos\theta
$$
The **angle sum identities** allow expanding out angles:
$$
\cos(a+b)=\cos a\cos b - \sin a\sin b \\
\sin(a+b)=\sin a\cos b + \cos a\sin b
$$
Subtracting angles is equal to the conjugates of the angle sum identities.
The **double angle identities** simplify the angle sum identity for a specific case.
$$
\sin2\theta = 2\sin\theta\cos\theta \\
$$
The **half angle formulas** are just random shit.
$$
1+\tan^2\theta = \sec^2\theta \\
\cos^2\theta = \frac{1}{2}(1+\cos2\theta) \\
\sin^2\theta = \frac{1}{2}(1-\cos2\theta)
$$
### Inverse trig functions
Because extending the domain does not pass the horizontal line test, for engineering purposes, inverse sine is only the inverse of sine so long as the angle is within $[-\frac{\pi}{2}, \frac{\pi}{2}]$. Otherwise, it is equal to that version mod 2 pi.
$$y=\sin^{-1}x \iff x=\sin y, y\in [-\frac{\pi}{2}, \frac{\pi}{2}]$$
This means that $x\in[-1, 1]$.
$$
\sin(\sin^{-1}x) = x \\
\sin^{-1}(\sin x) = x \text{ only if } x\in[-\frac{\pi}{2}, \frac{\pi}{2}]
$$
Similarly, inverse **cosine** only returns values within $[0,\pi]$.
Similarly, inverse **tangent** only returns values within $(-\frac{\pi}{2}, \frac{\pi}{2})$. However, $\tan^{-1}$ is defined for all $x\in\mathbb R$.
Although most of the reciprocal function rules can be derived, secant is only valid in the odd range $[-\pi, -\frac{\pi}{2})\cup [0, \frac{\pi}{2})$, and returns values $(-\infty, -1]\cup [1, \infty)$.
### Electrical signals
Waves are commonly presented in the following format, where $A$ is a **positive** amplitude:
$$g(t)=A\sin(\omega t + \alpha)$$
In general, if given a sum of a sine and cosine:
$$a\sin\omega t + b\cos\omega t = \sqrt{a^2 + b^2}\sin(\omega t + \alpha)$$
The sign of $\alpha$ should be determined via its quadrant via the signs of $a$ (sine) and $b$ (cosine) via the CAST rule.
!!! example
Given $y=5\cos 2t - 3\sin 2t$:
$$
\begin{align*}
A\sin (2t+\alpha) &= A\sin 2t\cos\alpha + A\cos 2t\sin\alpha \\
&= (A\cos\alpha)\sin 2t + (A\sin\alpha)\cos 2t \\
\\
\begin{cases}
A\sin\alpha = 5 \\
A\cos\alpha = -3
\end{cases}
\\
\\
A^2\sin^2\alpha + A^2\cos^2\alpha &= 5^2 + (-3)^2 \\
A^2 &= 34 \\
A &= \sqrt{34} \\
\\
\alpha &= \tan^{-1}\frac{5}{3} \\
&\text{since sine is positive and cosine is negative, the angle is in Q3} \\
∴ \alpha &= \tan^{-1}\frac{5}{3} + \pi
\end{align*}
$$
## Limits
### Limits of sequences
!!! definition
- A **sequence** is an infinitely long list of numbers with the **domain** of all natural numbers (may also include 0).
- A sequence that does not converge is a **diverging** sequence.
A sequence is typically denoted via braces.
$$\{a_n\}\text{ or } \{a_n\}^\infty_{n=0}$$
Sometimes sequences have formulae.
$$\left\{\frac{5^n}{3^n}\right\}^\infty_{n=0}$$
The **limit** of a sequence is the number $L$ that the sequence **converges** to as $n$ increases, which can be expressed in either of the two ways below:
$$
a_n \to L \text{ as } n\to\infty \\
\lim_{n\to\infty}a_n=L
$$
: > Specifically, a sequence $\{a_n\}$ converges to limit $L$ if, for any positive number $\epsilon$, there exists an integer $N$ such that $n>N \Rightarrow |a_n - L | < \epsilon$.
Effectively, if there is always a term number that would lead to the distance between the sequence at that term and the limit to be less than any arbitrarily small $\epsilon$, the sequence has the claimed limit.
!!! example
A limit can be proved to exist with the above definition. To prove $\left\{\frac{1}{\sqrt{n}}\right\}\to0$ as $n\to\infty$:
$$
\begin{align*}
\text{Proof:} \\
n > N &\Rightarrow \left|\frac{1}{\sqrt{n}} - 0\right| < \epsilon \\
&\Rightarrow \frac{1}{\epsilon^2} < n
\end{align*} \\
\ce{Let \epsilon\ be any positive number{.} If n > \frac{1}{\epsilon^2}, then \frac{1}{\sqrt{n}}-> 0 as n -> \infty{.}}
$$
Please see [SL Math - Analysis and Approaches 1#Limits](/g11/mhf4u7/#limits) for more information.
The **squeeze theorem** states that if a sequence lies between two other converging sequences with the same limit, it also converges to this limit. That is, if $a_n\to L$ and $c_n\to L$ as $n\to\infty$, and $a_n\leq b_n\leq c_n$ is **always true**, $b_n\to L$.
!!! example
$\left\{\frac{\sin n}{n}\right\}$: since $-1\leq\sin n\leq 1$, $\frac{-1}{n}\leq\frac{\sin n}{n}\leq \frac{1}{n}$. Since both other functions converge at 0, and sin(n) is always between the two, sin(n) thus also converges at 0 as n approaches infinity.
If function $f$ is continuous and $\lim_{n\to\infty}a_n$ exists:
$$\lim_{n\to\infty}f(a_n)=f\left(\lim_{n\to\infty}a_n\right)$$
On a side note:
$$\lim_{n\to\infty}\tan^{-1} n = \frac{\pi}{2}$$
### Limits of functions
The definition is largely the same as for the limit of a sequence:
: > A function $f(x)\to L$ as $x\to a$ if, for any positive $\epsilon$, there exists a number $\delta$ such that $0<|x-a|<\delta\Rightarrow|f(x)-L|<\epsilon$.
Again, for the limit to be true, there must be a value $x$ that makes the distance between the function and the limit less than any arbitrarily small $\epsilon$.
The extra $0 <$ is because the behaviour for when $x=a$, which may or may not be defined, is irrelevant.
!!! example
To prove $3x-2\to 4$ as $x\to 2$:
$$
\ce{for any \epsilon\ > 0, there is a \delta\ > 0\ such that:}
$$
$$
\begin{align*}
|x-2| < \delta &\Rightarrow|(3x-2) - 4| &< \epsilon \\
&\Leftarrow |(3x-2) -4| &< \epsilon \\
&\Leftarrow |3x-6| &< \epsilon \\
&\Leftarrow |x-2| &< \frac{\epsilon}{3} \\
\delta &= \frac{\epsilon}{3}
\end{align*}
$$
$$
\ce{Let \epsilon\ be any positive number{.} If }|x-2|<\frac{\epsilon}{3}, \\
\text{then }|(3x-2)-4|<\epsilon\text{. Therefore }3x-2\to 4\text{ as }x\to 2.
$$
!!! warning
When solving for limits, negatives have to be considered if the limit approaches a negative number:
$$\lim_{x\to -\infty}\frac{x}{\sqrt{4x^2-3}} = \frac{1}{-\frac{1}{\sqrt{x}^2}\sqrt{4x^2-3}}$$
As the angle in **radians** of an arc approaches 0, it is nearly equal to the sine (vertical component).
$$
\lim_{\theta\to 0}\frac{\sin\theta}{\theta} = 1
$$
This function is commonly used in engineering and is known as the sinc function.
$$
\text{sinc}(x) = \begin{cases}
\frac{\sin x}{x}&\text{ if }x\neq 0 \\
0&\text{ if }x=0
\end{cases}
$$
## Continuity
Please see [SL Math - Analysis and Approaches 1#Limits and continuity](/g11/mhf4u7/#limits-and-continuity) for more information.
Most common functions can be assumed to be continuous (e.g., $\sin x,\cos x, x, \sqrt{x}, \frac{1}{x}, e^x, \ln x$, etc.).
: > $f(x)$ is continuous in an interval if for any $x$ and $y$ in the interval and any positive number $\epsilon$, there exists a number $\delta$ such that $|x-y|<\delta\Rightarrow |f(x)-f(y)| < \epsilon$.
Effectively, if $f(x)$ can be made infinitely close to $f(y)$ by making $x$ closer to $y$, the function is continuous.
If two functions are continuous:
- $(f\circ g)(x)$ is continuous
- $(f\pm g)(x)$ is continuous
- $(fg)(x)$ is continuous
- $\frac{1}{f(x)}$ is continuous anywhere $f(x)\neq 0$
### Intermediate value theorem
The IVT states that if a function is continuous and there is a point between two other points, its term must also be between those two other points.
: > If $f(x)$ is continuous, if $f(a)\leq C\leq f(b)$, there must be a number $c\in[a,b]$ where $f(c)=C$.
The theorem is used to validate using binary search to find roots (guess and check).
### Extreme value theorem
The EVT states that any function continuous within a **closed** interval has at least one maximum and minimum.
: > If $f(x)$ is continuous in the **closed interval** $[a, b]$, there exist numbers $c$ and $d$ in $[a,b]$ such that $f(c)\leq f(x)\leq f(d)$.
## Derivatives
Please see [SL Math - Analysis and Approaches 1#Rate of change](/g11/mhf4u7/#rate-of-change) and [SL Math - Analysis and Approaches#Derivatives](/g11/mhf4u7/#derivatives) for more information.
The derivative of a function $f(x)$ at $a$ is determined by the following limit:
$$\lim_{x\to a}\frac{f(x)-f(a)}{x-a}$$
If the limit does not exist, the function is **not differentiable at $a$**.
Alternative notations for $f'(x)$ include $\dot f(x)$ and $Df$ (which is equal to $\frac{d}{dx}f(x)$).
Please see [SL Math - Analysis and Approaches 1#Finding derivatives using first principles](/g11/mhf4u7/#finding-derivatives-using-first-principles) and [SL Math - Analysis and Approaches 1#Derivative rules](/g11/mhf4u7/#derivative-rules) for more information.
Some examples of derivatives of inverse functions:
- $\frac{d}{dx}f^{-1}(x) = \frac{1}{\frac{dx}{dy}}$
- $\frac{d}{dx}\sin^{-1} x = \frac{1}{\sqrt{1-x^2}}$
- $\frac{d}{dx}\cos^{-1} x = -\frac{1}{\sqrt{1-x^2}}$
- $\frac{d}{dx}\tan^{-1} x = \frac{1}{1+x^2}$
- $\frac{d}{dx}\log_a x = \frac{1}{(\ln a) x}$
- $\frac{d}{dx}a^x = (\ln a)a^x$
### Implicit differentiation
Please see [SL Math - Analysis and Approaches 1#Implicit differentiation](/g11/mhf4u7/#implicit-differentiation) for more information.
### Mean value theorem
The MVT states that the average slope between two points will be reached at least once between them if the function is differentiable.
: > If $f(x)$ is continuous in $[a, b]$ and differentiable in $(a, b)$, respectively, there must be a $c\in(a,b)$ such that $f'(c)=\frac{f(b)-f(a)}{b-a}$.
### L'Hôpital's rule
As long as $\frac{f(x)}{g(x)} = \frac{0}{0}\text{ or } \frac{\infty}{\infty}$:
$$\lim_{x\to a}\frac{f(x)}{g(x)} = \lim_{x\to a}\frac{f'(x)}{g'(x)}$$
: > If $f(x)$ and $g(x)$ are differentiable (except maybe at $a$), and $\lim_{x\to a}f(x) = 0$ and $\lim_{x\to a}g(x) = 0$, the relation is true.
### Related rates
Please see [SL Math - Analysis and Approaches 1#Related rates](/g11/mhf4u7/#related-rates) for more information.
## Differentials
$\Delta x$ and $\Delta y$ represent tiny increments of $x$ and $y$. $dx$ and $dy$ are used when those tiny ammounts approach 0.
Specifically, by rearranging the definition of the deriative, $df$ is a short form for the **differential** of $f$:
$$f'(x)dx=dy=df$$
By abusing differentials, the tangent line of a point in a function can be approximated.
$$\Delta f\approx f'(x)\Delta x$$
!!! example
If $f(x) = \sqrt{x},x_0=81$, $\sqrt{78}$ can be estimated by:
$$
\begin{align*}
\Delta x&=dx=78-81=-3 \\
\frac{df}{dx} &= f'(x) \\
df &= f'(x)dx \\
&= \frac{1}{2\sqrt{81}}(-3) = -\frac{1}{6} \\
f(78) &= \sqrt{81}-\frac{1}{6} \\
&= \frac{53}{54}
\end{align*}
$$
### Curve sketching
Please see [SL Math - Analysis and Approaches 1#5.2 - Increasing and decreasing functions](/g11/mhf4u7/#52-increasing-and-decreasing-functions) for more information.
## Integrals
Please see [SL Math - Analysis and Approaches 2#Integration](/g11/mhf4u7/#52-increasing-and-decreasing-functions) for more information.
### More integration rules
- $\int a^xdx = \frac{a^x}{\ln a} + C$
- $\int\sec^2xdx=\tan x+C$
- $\int\text{cosh } xdx = \text{sinh } x + C$
- $\int\text{sinh } xdx = \text{cosh } x + C$
- $\int\frac{1}{\sqrt{1-x^2}}dx = \sin^{-1}x+C$
- $\int\csc^2xdx = -\cot x+C$
- $\int\sec x\tan x dx = \sec x + C$
- $\int\csc x\cot xdx = -\csc x + C$
- $\int\frac{1}{1+x^2}dx=\tan^{-1}x+C$
- $\int\sec xdx = \ln|\sec x + \tan x| + C$
- $\int\csc x dx = -\ln|\csc x + \cot x| + C$
### Integration by parts
IBP lets you replace an integration problem with a different, potentially easier one.
$$
\int u\ dv = uv-\int v\ du
$$
or, in function notation:
$$
\int u(x)v'(x)dx = u(x)v(x)-\int v(x)u'(x)dx
$$
Effectively, a product of two factors should be made simpler such that one is differentiable and the other is integratable. While there are integrals on both sides, the constant $C$ can be cancelled out for simplicity.
Heuristics to be used:
- $dv$ must be differentiable
- $u$ should be simpler when differentiated
- IBP might need to be used repeatedly
- IBP and u-substitution might be needed together
!!! example
To solve $\int xe^xdx$:
Let $u=x$, $dv=e^xdx$:
$\therefore du=dx, v=e^x + C$
via IBP:
$$
\begin{align*}
\int udv &= xe^x - \int e^xdx \\
&= xe^x-e^x + K
\end{align*}
$$
Please see [SL Math - Analysis and Approaches 2#Area between two curves](/g11/mcv4u7/#area-between-two-curves) for more information.
- A **Type 1** region is bounded by functions of $x$ — it's open-ended in the x-axis.
- A **Type 2** region is bounded by functions of $y$, which can be solved by integrating $y$.
- A **Type 3** region can be viewed as either Type 1 or 2.
Substituting $u=\cos\theta$, $du=-\sin\theta d\theta$ is common.
### Mean values
The **mean value** of a continuous function $f(x)$ in $[a, b]$ is equal to:
$$\text{m.v.} (f) = \frac{1}{b-a}\int_a^b f(x)dx$$
The **root mean square** is equal to the square root of the mean value for each point:
$$\text{r.m.s.} (f) = \sqrt{\frac{1}{b-a}\int_a^b f(x)^2dx}$$
### Trigonometric substitution
If $a\in\mathbb R$, functions of the form $\sqrt{x^2\pm a^2}$ or $\sqrt{a^2-x^2}$ can be rearranged in the form of a trig function.
- In $\sqrt{x^2 + a^2} \rightarrow x=a\tan\theta$
- In $\sqrt{x^2-a^2} \rightarrow x=a\sec\theta$
- In $\sqrt{a^2-x^2} \rightarrow x=a\sin\theta$
…which can be used to derive other trig identities to be integrated.
### Rational integrals
All integrals of rational functions are expressible as more rational functions, ln, and arctan.
Partial fraction decomposition is useful here.
$$\int \frac{1}{x^2+a^2}dx=\frac{1}{a}tan^{-1}\left(\frac{x}{a}\right)+C$$
## Summary of all integration rules
- $\int x^n\ dx = \frac{1}{n+1}x^{n+1} + C,n\neq -1$
- $\int \frac{1}{x}dx = \ln|x| + C$
- $\int e^x\ dx = e^x + C$
- $\int a^x\ dx = \frac{1}{\ln a} a^x + C$
- $\int\cos x\ dx = \sin x + C$
- $\int\sin x\ dx = -\cos x + C$
- $\int\sec^2 x\ dx = \tan x + C$
- $\int\csc^2 x\ dx = -\cot x + C$
- $\int\sec x\tan x\ dx = \sec x + C$
- $\int\csc x\cot x\ dx = -\csc x + C$
- $\int\text{cosh}\ x\ dx = \text{sinh}\ x + C$
- $\int\text{sinh}\ x\ dx = \text{cosh}\ x + C$
- $\int\text{sech}^2\ x\ dx = \text{tanh}\ x + C$
- $\int\text{sech}\ x\text{tanh}\ x\ dx = \text{sech}\ x + C$
- $\int\frac{1}{1+x^2}dx=\tan^{-1}x+C$
- $\int\frac{1}{a^2+x^2}dx=\frac{1}{a}\tan^{-1}\left(\frac{x}{a}\right)+C$
- $\int\frac{1}{\sqrt{1-x^2}}dx=\sin^{-1}x+C$
- $\int\frac{1}{x\sqrt{x^2-1}}dx=\sec^{-1}x+C$
- $\int\sec x\ dx = \ln|\sec x+\tan x|+C$
- $\int\csc x\ dx = -\ln|\csc x + \cot x|+C$
## Applications of integration
The length of a curve over a given interval is equal to:
$$L=\int^b_a\sqrt{1+\left(\frac{dy}{dx}\right)^2\ dx}$$
For curves bounded by functions of $y$:
$$L(y)=\int^b_a\sqrt{1+\left(\frac{dx}{dy}\right)^2\ dy}$$
### Solids of revolution
Please see [SL Math - Analysis and Approaches 2#Volumes of solids of revolution](/g11/mcv4u7/#volumes-of-solids-of-revolution) for more information.
The **parallel axis theorem can be used** to shift the axis of the solid to $y=k$:
$$V=\pi\int^b_a [f(x)^2 + 2kf(x)]\ dx$$
Around the vertical axis about the origin with a function that is bounded by $y$:
$$V=\int^b_a2\pixf(x)\ dx$$
Around the vertical axis about the origin with functions bounded by $x$:
$$V=\int^b_a2\pi(x-k)[f(x)-g(x)]\ dx$$
The **frustrum** is the sesction bounded by two parallel plates.
The surface area of the solids are as follows:
$$SA=\int^b_a2\pi f(x)\sqrt{1+f'(x)^2}\ dx$$
Around the vertical axis about the origin:
$$SA=\int^b_a2\pi x\sqrt{1+f'(x)^2}\ dx$$
### Improper integrals
An improper integral is a definite integral where only one bound is defined:
!!! example
$\int_2^\infty$ or $\int_a^b$, where only $a$ is defined.
These can be expanded into limits:
$$\int_a^\infty f(x)\ dx = \lim_{t\to\infty}\int_a^t f(x)\ dx$$
The integral converges to a value if the limit exists.
$$\int_{-\infty}^a f(x)\ dx = \lim_{t\to-\infty}\int^a_tf(x)\ dx$$
Discontinuities can be simply dodged. If there is a discontinuity:
- at $b$: $\int_a^{b^-}f(x)\ dx$
- at $a$: $\int_{a^+}^b f(x)\ dx$
- at $a<c<b$: $\int_a^cf(x)\ dx + \int_c^bf(x)\ dx$
Limits to both infinities must be broken up because they may not approach them at the same rate.
$$\int^\infty_{-\infty}x\ dx = \int^0_{-\infty} x\ dx + \int^\infty_0 x\ dx$$
## Polar form
Please see [MATH 115: Linear Algebra#Polar form](/ce1/math115/#polar-form) for more information.
Instead of $r$ and $\theta$, engineers use $\rho$ and $\phi$.
For $\rho \geq 0$, these basic conversions go between the two forms:
- $x=\rho\cos\phi$
- $y=\rho\sin\phi$
- $\phi=\sqrt{x^2+y^2}$
- $\phi=\tan^{-1}\left(\frac{y}{x}\right) + 2k\pi,k\in\mathbb Z$
Polar form allows for simpler representations such as $x^2+y^2=4 \iff \rho=2$
Functions are described in the form $\rho=f(\phi)$, such as $\rho=\sin\phi+2$.
### Area under curves
From the axis to the curve:
$$A=\int^\beta_\alpha\frac{1}{2}[f(\phi)]^2\ d\phi$$
Between two curves:
$$A=\int^\beta_\alpha\frac{1}{2}[f(\phi)^2-g(\phi)^2]\ d\phi$$
Arc length:
$$L=\int^\beta_\alpha\sqrt{f'(\phi)^2 + f(\phi)^2}\ d\phi = \int^\beta_\alpha\sqrt{\left(\frac{d\rho}{d\phi}\right)^2+\rho^2}\ d\phi$$
## Complex numbers
Please see [MATH 115: Linear Algebra#Complex Numbers](/ce1/math115/#complex-numbers) for more information.
### Impedance
Where $\~i$ is a complex number representing the current of a circuit:
$$\~i(t)=I\cdot Im(e^{j\omega t})$$
This can be related to Ohm's law, because $v(t)=IR\sin(\omega t)$ such that $\~v=IRe^{j\omega t}$:
$$\~v=R\~i$$
In fact, t
$$
\~v=Z\~i,\text{ where } Z=\begin{cases}
\begin{align*}
&R &\text{ for resistors} \\
&\frac{1}{j\omega C} &\text{ for capacitors} \\
&j\omega L &\text{ for inductors}
\end{align*}
\end{cases}
$$
Impedance has similar properties to resistance.
- In series: $Z = Z_1 + Z_2 + Z_3 ...$
- In parallel: $\frac{1}{Z} = \frac{1}{Z_1} + \frac{1}{Z_2} + \frac{1}{Z_3} ...$

View File

@ -1,701 +0,0 @@
# ECE 106: Electricity and Magnetism
## MATH 117 review
!!! definition
A definite integral is composed of:
- the **upper limit**, $b$,
- the **lower limit**, $a$,
- the **integrand**, $f(x)$, and
- the **differential element**, $dx$.
$$\int^b_a f(x)\ dx$$
The original function **cannot be recovered** from the result of a definite integral unless it is known that $f(x)$ is a constant.
## N-dimensional integrals
Much like how $dx$ represents an infinitely small line, $dx\cdot dy$ represents an infinitely small rectangle. This means that the surface area of an object can be expressed as:
$$dS=dx\cdot dy$$
Therefore, the area of a function can be expressed as:
$$S=\int^x_0\int^y_0 dy\ dx$$
where $y$ is usually equal to $f(x)$, changing on each iteration.
!!! example
The area of a circle can be expressed as $y=\pm\sqrt{r^2-x^2}$. This can be reduced to $y=2\sqrt{r^2-x^2}$ because of the symmetry of the equation.
$$
\begin{align*}
A&=\int^r_0\int^{\sqrt{r^2-x^2}}_0 dy\ dx \\
&=\int^r_0\sqrt{r^2-x^2}\ dx
\end{align*}
$$
!!! warning
Similar to parentheses, the correct integral squiggly must be paired with the correct differential element.
These rules also apply for a system in three dimensions:
| Vector | Length | Area | Volume |
| --- | --- | --- | --- |
| $x$ | $dx$ | $dx\cdot dy$ | $dx\cdot dy\cdot dz$ |
| $y$ | $dy$ | $dy\cdot dz$ | |
| $z$ | $dz$ | $dx\cdot dz$ | |
Although differential elements can be blindly used inside and outside an object (e.g., area), the rules break down as the **boundary** of an object is approached (e.g., perimeter). Applying these rules to determine an object's perimeter will result in the incorrect deduction that $\pi=4$.
Therefore, further approximations can be made using the Pythagorean theorem to represent the perimeter.
$$dl=\sqrt{(dx^2) + (dy)^2}$$
### Polar coordinates
Please see [MATH 115: Linear Algebra#Polar form](/1a/math115/#polar-form) for more information.
In polar form, the difference in each "rectangle" side length is slightly different.
| Vector | Length difference |
| --- | --- |
| $\hat r$ | $dr$ |
| $\hat\phi$ | $rd\phi$ |
Therefore, the change in surface area can be approximated to be a rectangle and is equal to:
$$dS=(dr)(rd\phi)$$
!!! example
The area of a circle can be expressed as $A=\int^{2\pi}_0\int^R_0 r\ dr\ d\phi$.
$$
\begin{align*}
A&=\int^{2\pi}_0\frac{1}{2}R^2\ d\phi \\
&=\pi R^2
\end{align*}
$$
If $r$ does not depend on $d\phi$, part of the integral can be pre-evaluated:
$$
\begin{align*}
dS&=\int^{2\pi}_{\phi=0} r\ dr\ d\phi \\
dS^\text{ring}&=2\pi r\ dr
\end{align*}
$$
So long as the variables are independent of each other, their order does not matter. Otherwise, the dependent variable must be calculated first.
!!! tip
There is a shortcut for integrals of cosine and sine squared, **so long as $a=0$ and $b$ is a multiple of $\frac\pi 2$**:
$$
\int^b_a\cos^2\phi=\frac{b-a}{2} \\
\int^b_a\sin^2\phi=\frac{b-a}{2}
$$
The side length of a curve is as follows:
$$dl=\sqrt{(dr^2+(rd\phi)^2}$$
!!! example
The side length of the curve $r=e^\phi$ (Archimedes' spiral) from $0$ to $2\pi$:
\begin{align*}
dl &=d\phi\sqrt{\left(\frac{dr}{d\phi}\right)^2 + r^2} \\
\tag{$\frac{dr}{d\phi}=e^\phi$}&=d\phi\sqrt{e^{2\phi}+r^2} \\
&=????????
\end{align*}
Polar **volume** is the same as Cartesian volume:
$$dV=A\ dr$$
!!! example
For a cylinder of radius $R$ and height $h$:
$$
\begin{align*}
dV&=\pi R^2\ dr \\
V&=\int^h_0 \pi R^2\ dr \\
&=\pi R^2 h
\end{align*}
$$
### Moment of inertia
The **mass distribution** of an object varies depending on its surface density $\rho_s$. In objects with uniformly distributed mass, the surface density is equal to the total mass over the total area.
$$dm=\rho_s\ dS$$
The formula for the **moment of inertia** of an object is as follows, where $r_\perp$ is the distance from the axis of rotation:
$$dI=(r_\perp)^2dm$$
If the axis of rotation is perpendicular to the plane of the object, $r_\perp=r$. If the axis is parallel, $r_\perp$ is the shortest distance to the axis. Setting an axis along the axis of rotation is easier.
!!! example
In a uniformly distributed disk rotating about the origin like a CD with mass $M$ and radius $R$:
$$
\begin{align*}
\rho_s &= \frac{M}{\pi R^2} \\
dm &= \rho_s\ r\ dr\ d\phi \\
dI &=r^2\ dm \\
&= r^2\rho_s r\ dr\ d\phi \\
&= \rho_s r^3dr\ d\phi \\
I &=\rho_s\int^{2\pi}_{\phi=0}\int^R_{r=0} r^3dr\ d\phi \\
&= \rho_s\int^{2\pi}_{\phi=0}\frac{1}{4}R^4d\phi \\
&= \rho_s\frac{1}{2}\pi R^4 \\
&= \frac 1 2 MR^2
\end{align*}
$$
## Electrostatics
!!! definition
- The **polarity** of a particle is whether it is positive or negative.
The law of **conservation of charge** states that electrons and charges cannot be created nor destroyed, such that the **net charge in a closed system stays the same**.
The law of **charge quantisation** states that charge is discrete — electrons have the lowest possible quantity.
Please see [SL Physics 1#Charge](/sph3u7/#charge) for more information.
**Coulomb's law** states that for point charges $Q_1, Q_2$ with distance from the first to the second $\vec R_{12}$:
$$\vec F_{12}=k\frac{Q_1Q_2}{||R_{12}||^2}\hat{R_{12}}$$
!!! warning
Because Coulomb's law is an experimental law, it does not quite cover all of the nuances of electrostatics. Notably:
- $Q_1$ and $Q_2$ must be point charges, making distributed charges inefficient to calculate, and
- the formula breaks down once charges begin to move (e.g., if a charge moves a lightyear away from another, Coulomb's law says the force changes instantly. In reality, it takes a year before the other charge observes a difference.)
### Dipoles
An **electric dipole** is composed of two equal but opposite charges $Q$ separated by a distance $d$. The dipole moment is the product of the two, $Qd$.
The charge experienced by a positive test charge along the dipole line can be reduced to as the ratio between the two charges decreases to the point that they are basically zero:
$$\vec F_q=\hat x\frac{2kQdq}{||\vec x||^3}$$
## Maxwell's theorems
Compared to Coulomb's law, $Q_1$ creates an electric field around itself — each point in space is assigned a vector that depends on the distance away from the charge. $Q_2$ *interacts* with the field. According to Maxwell, as a charge moves, it emits a wave that carries information to other charges.
The **electric field strength** $\vec E$ is the force per unit *positive* charge at a specific point $p$:
$$\vec E_p=\lim_{q\to 0}\frac{\vec{F}}{q}$$
Please see [SL Physics 1#Electric potential](/sph3u7/#electric-potential) for more information.
### Electric field calculations
If charge is distributed over a three-dimensional object, integration similar to moment of inertia can be used. Where $dQ$ is an infinitely small point charge at point $P$, $d\vec E$ is the electric field at that point, and $r$ is the vector representing the distance from any arbitrary point:
$$d\vec E = \frac{kdQ}{r^2}\hat r$$
!!! warning
As the arbitrary point moves, both the direction and the magnitude of the distance from the desired point $P$ change (both $\hat r$ and $r$).
Generally, if a decomposing the vector into Cartesian forms $d\vec E_x$, $d\vec E_y$, and $d\vec E_z$ is helpful even if it is easily calculated in polar form because of the significantly easier ability to detect symmetry in the shape. Symmetry about the axis allows deductions such as $\int d\vec E_y=0$, which makes calculations easier.
In a **one-dimensional** charge distribution (a line), the charge density is used in a similar way as moment of inertia's surface density:
$$dQ=\rho_\ell d\ell$$
**Two-dimensional** charge distributions are more or less the same, but polar or Cartesian forms of the surface area work depending on the shape.
$$dQ=\rho_s dS$$
!!! example
A rod of uniform charge density and length $L$ has a charge density of $p_\ell=\frac{Q}{L}$.
1. Determine the formula for the charge density $\rho$
2. Choose an origin and coordinate system (along the axes of the object when possible)
3. Choose an arbitrary point $A$ on the charge
4. Create a right-angle triangle with $A$, the desired point, and usually the origin
5. Attempt to find symmetry
6. Solve
## Gauss's law
!!! definition
- A **closed surface** is any closed three-dimensional object.
- **Electric flux** represents the number of electric field lines going through a surface.
At an arbitrary surface, the **normal** to the plane is its vector form:
$$\vec{dS}=\vec n\cdot dS$$
The **electric flux density** $\vec D$ is an alternate representation of electric field strength. In a vacuum:
$$\vec D = \epsilon_0\vec E$$
**Electric flux** is the electric flux density multiplied by the surface area at every point of an object.
$$\phi_e=\epsilon_0\int_s\vec E\bullet\vec{dS}$$
The flux from charges outside a closed surface will **always be zero at the surface**. A point charge in the centre of a closed space has a flux equal to its charge. Regardless of the charge distribution or shape, the **total flux** through a closed surface is equal to the **total charge within** the closed surface.
$$\oint \vec D\bullet\vec{dS}=Q_\text{enclosed}$$
This implies $\phi_e>0$ is a net positive charge enclosed.
!!! warning
Gauss's law only applies when $\vec E$ is from all charges in the system
### Charge distributed over a line/cylinder
!!! warning "Limitations"
To apply this strategy, the following conditions must hold:
- $Q$ must not vary with the length of the cylinder or $\phi$
- The charge must be distributed over either a cylindrical surface or the volume of the cylinder.
- In the real world, $r$ must be significantly smaller than $L$ as an approximation.
- The strategy is more accurate for points closer to the centre of the wire.
Please see [Maxwell's integral equations#Gauss's law](https://en.wikiversity.org/wiki/MyOpenMath/Solutions/Maxwell%27s_integral_equations) for more information.
**Outside** the radius $R$ of the cylinder of the Gaussian surface, the enclosed charge is, where $L$ is the length of the cylinder:
$$Q_{enc}=\pi R^2\rho_0L$
such that the field at any radius $r>R$ is equal to:
$$\vec E(r)=\frac{\rho_0\pi R^2}{2\pi\epsilon_0r}\hat r$$
**Inside** the radius $R$ of the cylinder, the enclosed charge depends on $r$. For a uniform charge density:
$$Q_{enc}=\pi r^2\rho_0L$$
such that the field at any radius $r< R$ is equal to:
$$\vec E(r)=\frac{\rho_0}{2\epsilon_0}r\hat r$$
The direction of $\vec E$ should always be equal to that of $\vec r$. Generally, where $lim$ is $r$ if $r$ is *inside* the cylinder or $R$ otherwise, $\rho_v$ is the function for charge density based on radius, and $r_1$ is hell if I know:
$$\epsilon_0 E2\pi rL=\int^{lim}_0\rho_v(r_1)2\pi r_1L\ dr_1$$
### Charge distributed over a plane
!!! warning
To apply this strategy, the following conditions must hold:
- $Q$ must not vary with the lengths of the plane
- The charge must be distributed over a plane or slab
- In the real world, the thickness $z$ must be significantly smaller than the lengths as an approximation
Where $\rho_v$ is an **even** surface density function and $lim$ is from $0$ to $z$ if the desired field is outside of the charge, or $0$ to field height $h$ if it is inside the charge:
$$\epsilon_0 E=\int_{lim}\rho_v\ dh_1$$
Any two points have equal electric fields regardless of distance due to the construction of a uniform electric field.
Where $\rho_v$ is not an even surface density function, $d$ is the thickness of the slab, and $E$ is the electric field **outside** the slab:
$$2\epsilon_0E = \int^d_0\rho_v(A)dh_1$$
Where $E$ is the electric field **inside** the slab at some height $z$:
$$E=\frac{\rho_0}{4\epsilon_0}(2z^2-d^2),0\leq z\leq d$$
If $E$ is negative, it must point opposite the original direction ($\hat z$).
Generally:
1. Determine $\vec E$ outside the slab.
2. Set one outside surface and one inside surface as a pillbox and apply rules.
## Electrostatic potential
At a point $P$, the electrostatic potential $V_p$ or voltage is the work done per unit positive test charge from infinity to bring it to point $P$ by an external agent.
$$
V_p=\lim_{q\to 0^+}\frac{W_i}{q} \\
W_I=\int^p_\infty\vec F_I\bullet \vec{dl}=\Delta U=QV_p
$$
Because the desired force acts opposite to the force from the electric field, as long as $\vec E$ is known at each point:
$$
V_p=-\int^p_\infty\vec E\bullet\vec{dl} \\
V_p=-\int^p_\infty E\ dr
$$
The work done only depends on initial and final positions — it is conservative, thus implying Kirchoff's voltage law.
Where $\vec dl$ is the path of the test charge from infinity to the point, and $\vec dr$ is the direct path from the origin through the point to the charge, because $dr=-dl$:
$$\vec E\bullet\vec{dl}=Edr$$
Therefore, the potential due to a point charge is equal to (the latter is true only if distance from charge is always constant, regardless of distribution):
$$V_p=-\int^p_\infty\frac{kQ}{r^2}dr=\frac{kQ}{r}$$
**Positive** charges naturally move to **lower** potentials ($V$ decreases) while negative charges do the opposite. Potential energy always decreases.
In order to calculate the voltage for charge distributions:
- If $\vec E$ is easy to find via Gauss law:
$$V_p=-\int^p_\infty\vec E\bullet\vec{dl}$$
- If the charge is asymmetric:
$$V_p=\int_\text{charge dist}\frac{kdQ}{r}$$
The electric field always points in the direction of **lower** potential, and is equal to the **negative gradient** of potential.
$$\vec E=-\nabla V$$
If $\vec E$ is constant:
$$\vec E=\frac{Q_{enc\ net}}{\epsilon_0\oint dS}$$
The **superposition** principle allows potential due to different charges to be calculated separately and summed together to achieve the same result.
## Conductors
An **ideal conductor** has electrons loosely bound to atoms such that an electric field causes them to freely move by $F=Q_e E$. However, this assumes that there are infinite electrons in the conductor, and that the electrons will move with **zero resistance** to the surface of the conductor but **not leave it**.
A conductor placed in an external electric field will cause electrons to hop from atom to atom to reach the surface, charging one surface negatively and the other positively. The **induced electric field** from this imbalance opposes the external field force, slowing down electron movement until equilibrium is reached.
$$\text{equilibrium}\iff \vec E_{ext}+\vec E_{ind}=\vec 0$$
At equilibrium, **every point in the conductor is equipotential**. Gauss's law implies that there is no volume charge inside a conductor.
At its surface, $\vec E$ tangent to the surface must be zero. Normal to the surface:
$$|\vec E_N|=\frac{|\rho_0|}{\epsilon_0}$$
- $\rho_0$ is negative if field lines **enter** the conductor.
- $\rho_0$ is positive if field lines exit the conductor.
### Conductor cavities
A cavity surface must have **zero surface charge**. This creates a Faraday cage — outside fields cannot affect the cavity, but fields from the cavity can affect the outside world.
If there is a fixed/non-moving charge $Q$ in the cavity:
- $\vec E=0$ inside the conductor, so the boundary surface charge must be $-Q$.
- Electrons are taken from the surface, so the surface charge outside the conductor must be $Q$, propagating the effect of the charge to the outside world.
### Ground
A **ground** is a reservoir or sink of charges that never changes, regardless of the quantity added or removed from it. At the connection point, $V=0$ is always guaranteed.
Grounding a conductor means that it takes charges from the ground to balance an internal charge, neutralising it.
A charge released into a conductor (e.g., battery into wire) will always go to the outside surface, regardless of the point of insertion. Two charged objects connected by a thin conductor will redistribute their charge such that:
- their potentials are equal
- conservation of charge is followed.
This implies that a larger object has more charge, but a smaller object has a denser charge and thus stronger electric field.
$$Q_1=\frac {R_1} {R_2}Q_2$$
!!! example
For two spheres, as $\rho=\frac{Q_1}{4\pi R^2}$:
$$\rho_1=\frac {R_2} {R_1}\rho_2$$
A non-uniform object, such as a cube, will have larger charge density / stronger electric field at sharper points in its shape. Symmetrical surfaces always have uniform charge density.
!!! warning
An off-centre charge in a cavity will require a non-uniform induced charge to cancel out the internal field, but the external surface charge will be uniform (or non-uniform if the surface is odd).
### Nutshell
**Inside** a conductor:
- $\vec E=0$
- $\Delta V=0$
- $\rho_v=0$
Inside a cavity, if there exists an external field:
- $\vec E=0$
- $\rho_s=-Q$
- $\rho_{s\ outer}=Q$
The inner surface charge distribution matches that of the inner charge, but the outer surface charge distribution is dependent only on the shape of the conductor.
On conductor surfaces, the only $\vec E$ is **normal** to the surface and dependents on the shape of the surface.
$$|\vec E_N|=\frac{|\rho_s|}{\epsilon_0}$$
Grounding a conductor neutralises any free charges.
In slabs, as $A>>d$, assume $Q$ is uniformly distributed.
To solve systems:
- Assigning charge **density** is easier with sheets
- Assigning **charges** is easier with cylinders/spheres
## Dielectrics
!!! definition
- An **insulator** has electrons tightly bound to atoms.
### Polarisation
Polarisation is the act of inducing a dipole to a lesser extent than conductors. The induced field cannot reduce $\vec E$ inside the insulator to zero, but it will reduce its effects. The **polarisation vector** $\vec P$ is an average of the effects of all induced fields on a certain point inside a volume.
$$\vec P=\lim_{\Delta V\to 0}\frac{\sum^{N\Delta v}\vec p_i}{\Delta v}$$
where:
- $\Delta v\approx dv$ is the volume of the insulator
- $p_i$ is the dipole moment at a point
- $N$ is the total number of atoms in the volume
Polarisation is proportional to electric field and the **electric susceptibility** $X_e$ of a material to external fields.
$$\boxed{\vec P=\epsilon_0X_e\vec E}$$
The **relative permittivity** $\epsilon_r$ of a material is the ratio of decreasing $\vec E$ inside a medium relative to free space.
$$\epsilon_r=1+X_e$$
The new **flux density** formula includes polarised charges, so now $Q_{enc}$ includes **only free charges** (i.e., not polarised charges).
$$\boxed{\vec D=\epsilon_0\vec E+\vec P=\epsilon_0\epsilon_r\vec E}$$
$$\boxed{\oint\vec D\bullet\vec{dS}=Q_{enc,free}}$$
In uniform charge distributions, the surface charge density is related to its polarisation. Where $\hat n$ is the unit normal of the surface:
$$\rho_s=\vec P\bullet\hat n$$
### Boundary conditions
Regardless of permittivity, the $\vec E$ **tangential to the boundary** between two materials must be equal.
## Capacitors
!!! definition
- A **capacitor** is a device that uses the capacitance of materials to store energy in electric fields. It is usually composed of two conductors separated by a dielectric.
**Capacitance** is a measurement of the charge that can be stored per unit difference in potential.
$$\boxed{Q=C\Delta V}$$
To determine $C$:
1. Place a positive and a negative charge on conductors
2. Determine charge distribution
3. Determine $\vec E$ between the conductors
4. Find a path from the negative to the positive conductor and determine voltage
??? example
For two plates separated by distance $d$, with charges of $+Q$ and $-Q$, and a dielectric in between with permittivity $\epsilon_0\epsilon_r$:
- Clearly $\rho_0=\frac Q A$ as sheets must have uniform distribution. $-\rho_0$ is on the negative plate.
- From Gauss' law, creating a Gaussian surface outside the capacitor to between the plates gives $DA=\rho_0A$.
- $D=\epsilon_0\epsilon_rE$ gives $E=\frac{\rho_0}{\epsilon_0\epsilon_r}$
- Sheets have uniform fields, thus $\Delta V=Ed$
- Finally, $C=\epsilon_0\epsilon_r\frac A d$
!!! warning
If three dielectrics with different permittivities are allowed to touch each other, they will create **fringe fields** at their intersection that destroy the boundary condition.
### Capacitors and energy
The stored energy inside capacitors is the same as any other energy.
$$\boxed{U_e=\frac 1 2CV^2}$$
Much like VIR, it's usually easier to work with the form of the equation that has squared constants.
$$U_e=\frac 1 2 \frac {Q^2}{C}=\frac 1 2 QV$$
Adding dielectrics increases capacitance but decrease stored energy.
## Magnetism
All magnetic field lines are closed, i.e., they all return to the same magnetic object, much like a dipole. All lines must be perpendicular to the surface:
$$\oint\vec B\bullet\vec{dS}=0$$
Per **Biot-Savart's law**, magnets are complicated.
$$\boxed{d\vec B_p=\frac{\mu_0}{4\pi}I\frac{\vec {dl}\times\hat r}{|r|^2}}$$
where:
- $\mu_0$ is the magnetic permeability of free space
- $\hat r$ is the unit vector pointing from an arbitrary point of a wire to the desired point
- $I$ is current
- $dl$ follows the direction of current
The final direction can be determined in advance with the **right-hand rule**. Therefore, magnitude can be reduced to:
$$|dl\times\hat r|=|dl||\hat r|\sin\theta=|dl|\sin\theta$$
### Calculations
1. Define coordinate system
2. Go to some arbitrary point $A$ on a coordinate axis such that $r=AP$
3. Determine magnitude of the cross product
4. Determine final magnetic field direction (should be constant)
5. Rewrite equation in terms of one variable (usually $\theta$)
6. Integrate
### Selenoids
It's easiest to place the origin at the target point.
A selenoid with $N$ turns around a coil of length $L$ has density $n$, and has parallel electric fields inside.
$$n=\frac N L$$
The effective current of a selenoid for magnetic purposes is the sum of all currents.
$$\boxed{I_{eff}=ndzI}$$
where:
- $dz$ is the axis in the direction of current
- $I$ is current
This can be substituted directly into Biot-Savart's law, although definite integration should be done **in the direction of the axis** (from the desired point to the farthest point of the selenoid).
### Velocity and current
Biot-Savart's law can be applied to moving charges:
$$I\cdot \vec{dl}=\frac{dq\cdot dl}{dt}=dq\cdot \vec v$$
### Ampere's law
!!! definition
- **Drift velocity** is the average speed of electrons through a material.
The **current density** $\vec J$ is the amount of charge per unit time that flows through a unit area of a cross section.
$$\boxed{\vec J=nq\vec u=\rho_v\vec u}$$
where:
- $\vec u$ is drift velocity
- $n$ is the charge per unit volume
- $q$ is the total charge
Ohmic resistors have current density proportional to electric field by a material's **conductivity** $\sigma$.
$$\vec J=\sigma\vec E$$
Resistivity is related to conductivity: $\rho=\frac 1\sigma$
Integrating over a cross section returns current:
$$\boxed{I=\oint\vec J\bullet\vec{dS}}$$
**Ampere's law** asserts that magnetic flux due to all currents is equal to current enclosed inside a closed boundary/loop.
$$
\boxed{\begin{align*}
\oint\vec B\bullet\vec{dl}&=\mu_0I_{enc} \\
&=\mu_0\oint\vec J\bullet\vec{dS}
\end{align*}}
$$
where:
- $dl$ is the line along the loop/boundary in an arbitrary direction
- $I_{enc}$ is the sum of all enclosed currents
$dl$ (along the loop) and $dS$ are related in direction with each other per the **right hand rule**.
!!! warning
Ampere's law is only true in when dealing with DC.
For each enclosed $I$, if its direction is:
- the same as $\vec dS$, it is positive in the sum term
- opposite $\vec dS$, it is negative in the sum term
1. Use $dl$ to find $dS$ or vice versa
2. Determine $I_{enc}$
3. Solve
The angle of a cut to a surface does not affect any equations and can be treated identically. Any imaginary closed loop such that $\vec B$ **is constant over the loop and parallel to the loop** is usable with Ampere's law as $B$ can be reduced to a constant scalar.
The geometries that work include:
- Infinite cylinders with $J$ that may vary with $r$ but not $\phi$
- Infinite sheets/slabs where $J$ may vary with $z$ but not $x,y$
- Infinite selenoids
- Toroids (a selenoid bent into a donut shape)
1. Create a cross-section perpendicular to the current and determine if symmetry of the loop can meet conditions for geometry
2. Choose $dl$ in the direction of $B$ (counterclockwise)
3. Determine $dS$ (out of the page) and apply Ampere's law
$$\hat\phi=\hat z\times\hat r_1$$
!!! warning
A spinning cylinder rotates faster along its outer ring, forcing an integral setup.
### Faraday's law
Faraday's law states relates magnetic flux similarly to electric flux. Where $s$ is the open surface bounded by the conductor:
$$\phi_m=\int_s\vec B\bullet\vec{dS}$$
A flux that changes with time results in an **induced voltage** across the terminals of the conductor. Per Faraday's law of electromagnetic induction, magnetic energy is convertible to electric energy.
$$V_{ind}=-\frac{d}{dt}\phi_m$$
As the electric field is always perpendicular to a magnetic field, this indicates that it will curl around a straight magnetic field.
Relating $dl$ and $dS$ with the right-hand rule accounts for **Lenz's law**, which creates a $\vec E$ to create a $\vec B$ to oppose the change in $\phi_m$ that created the current.
$$\boxed{\oint\vec E\bullet\vec{d\ell}=\frac{d}{dt}\int\vec B\bullet\vec{dS}}$$
If there is a conducting loop in a time-varying magnetic field, a $V_{ind}$ is formed such that the current is in the direction of the induced field:
$$V_{ind}=\oint\vec E\bullet\vec{d\ell}=-\frac{d}{dt}\int\vec B\bullet\vec{dS}$$
Time-varying magnetic fields are formed if the field or charge is moving or if bounds change.
## Inductance
Kirchoff's voltage law is a simplification of Faraday's law, valid when there is no fluctuating magnetic field within the closed loop, so it's used with low frequency waves with less time variation.
The **inductance** is the flux travelling through a medium over its current.
$$L=\frac{\phi_m}{i}$$
If there are $N$ loops in a selenoid, where $\Lambda=N\phi_m$ is the total flux/**flux linkage**, $i$ is the current in one loop, and $I$ is the current of all loops:
$$L=\frac{\phi_m}{i}=\frac{\Lambda}{I_{eff}}$$
The **energy density** per unit volume is $u_m$.
$$u_m=\frac 1 2 \frac {B^2}{\mu_0}$$
The **total work** $U_m$ done to charge current from $0$ to $I$ is related to energy density.
$$U_m=\sqrt u_m=\frac 1 2 LI^2$$
$$\boxed{\frac 1 2 LI^2=\frac 1 2\int_{volume}U_mdV}$$
### Self-inductance
A magnetic flux that passes through the current that created it will induce voltage if $I$ changes.
**Mutual inductance** is wireless charging as changing current in one coil produces a changing magnetic flux in another, creating a voltage $\epsilon_{1\to 2}$.
$$V_{ind}=\epsilon_{1\to 2}=N_2\frac{d\phi_{1\to 2}}{dt}=-\frac{d}{dt}\int \vec B_1\bullet\vec{dS}_2$$
The mutual inductance is the rate of change of magnetic flux proportional to the rate of change of current. It is equal regardless of direction.
$$\boxed{M_{1\to 2}=\frac{N_2\phi_{1\to 2}}{I_1}}$$

View File

@ -1,958 +0,0 @@
# ECE 108: Discrete Math 1
An **axiom** is a defined core assumption of the mathematical system held to be true without proof.
!!! example
True is not false.
A **theorem** is a true statement derived from axioms via logic or other theorems.
!!! example
True or false is true.
A **proposition/statement** must be able to have the property that it is exclusively true or false.
!!! example
The square root of 2 is a rational number.
An **open sentence** becomes a proposition if a value is assigned to the variable.
!!! example
$x^2-x\geq 0$
## Truth tables
A truth table lists all possible **truth values** of a proposition, containing independent **statement variables**.
!!! example
| p | q | p and q |
| --- | --- | --- |
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
## Logical operators
!!! definition
- A **compound statement** is composed of **component statements** joined by logical operators AND and OR.
The **negation** operator is equivalent to logical **NOT**.
$$\neg p$$
The **conjunction** operaetor is equivalent to logical **AND**.
$$p\wedge q$$
The **disjunction** operator is equivalent to logical **OR**.
$$p\vee q$$
### Proposation relations
!!! definition
A **tautology** is a statement that is always true, regardless of its statement variables.
The **implication** sign requires that if $p$ is true, $q$ is true, such that *$p$ implies $q$*. The first symbol is the **hypothesis** and the second symbol is the **conclusion**.
$$p\implies q$$
| $p$ | $q$ | $p\implies q$ |
| --- | --- | --- |
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | F |
The **inference** sign represents the inverse of the implication sign, such that $p$ **is implied by** $q$. It is equivalent to $q\implies p$.
$$p\impliedby q$$
The **if and only if** sign requires that the two propositions imply each other — i.e., that the state of $p$ is the same as the state of $q$. It is equivalent to $(p\implies q)\wedge (p\impliedby q)$.
$$p\iff q$$
The **logical equivalence** sign represents if the truth values for both statements are **the same for all possible variables**, such that the two are **equivalent statements**.
$$p\equiv q$$
$p\equiv q$ can also be defined as true when $p\iff q$ is a tautology.
!!! warning
$p\equiv q$ is *not a proposition* itself but instead *describes* propositions. $p\iff q$ is the propositional equivalent.
## Common theorems
The **double negation rule** states that if $p$ is a proposition:
$$\neg(\neg p)\equiv p$$
!!! tip "Proof"
Note that:
| $p$ | $\neg p$ | $\neg(\neg p)$ |
| --- | --- | --- |
| T | F | T |
| F | T | F |
Because the truth values of $p$ and $\neg(\neg p)$ for all possible truth values are equal, by definition, it follows that $p\equiv\neg(\neg p)$.
!!! warning
Proofs must include the definition of what is being proven, and any relevant evidence must be used to describe why.
The two **De Morgan's Laws** allow distributing the negation operator in a dis/conjunction if the junction is inverted.
$$
\neg(p\vee q)\equiv(\neg p)\wedge(\neg q) \\
\neg(p\wedge q)\equiv(\neg p)\vee(\neg q)
$$
An implication can be expressed as a disjunction. As long as it is stated, it can used as its definition.
$$p\implies \equiv (\neg p)\vee q$$
Two **converse** propositions imply each other:
$$p\implies q\text{ is the converse of }q\implies p$$
A **contrapositive** is the negatated converse, and is **logically equivalent to the original implication**. This allows proof by contrapositive.
$$\neg p\implies\neg q\text{ is the contrapositive of }q\implies p$$
### Operator laws
Both **AND** and **OR** are commutative.
$$
p\wedge q\equiv q\wedge p \\
p\vee q\equiv q\vee p
$$
Both **AND** and **OR** are associative.
$$
(p\wedge q)\wedge r\equiv p\wedge(q\wedge r) \\
(p\vee q)\vee r\equiv p\vee(q\vee r)
$$
Both **AND** and **OR** are distributive with one another.
$$
p\wedge(q\vee r)\equiv(p\wedge q)\vee(p\wedge r) \\
p\vee(q\wedge r)\equiv(p\vee q)\wedge(p\vee r)
$$
!!! tip "Proof"
$$
\begin{align*}
(\neg p\vee\neg r)\wedge s\wedge\neg t&\equiv\neg(p\wedge r\vee s\implies t) \\
\tag*{definition of implication} &\equiv \neg (p\wedge r\vee[\neg s\vee t]) \\
\tag*{DML} &\equiv\neg(p\wedge r)\wedge\neg[(\neg s)\vee t)] \\
\tag*{DML} &\equiv(\neg p\vee\neg r)\wedge\neg[(\neg t)\vee t] \\
\tag*{DML} &\equiv(\neg p\vee\neg r)\wedge\neg(\neg s)\wedge\neg t \\
\tag*{double negation} &\equiv(\neg p\vee\neg r)\wedge s\wedge\neg t
\end{align*}
$$
### Quantifiers
A **quantified statement** includes a **quantifier**, **variable**, **domain**, and **open sentence**.
$$
\underbrace{\text{for all}}_\text{quantifier}\ \underbrace{\text{real numbers}\overbrace{x}^\text{variable}\geq 5}_\text{domain}, \underbrace{x^2-x\geq 0}_\text{open sentence}
$$
The **universal quantifier** $\forall$ indicates "for all".
$$\forall x\in S,P(x)$$
!!! example
All real numbers greater than or equal to 5, defined as $x$, satisfy the condition $x^2-x\geq 0$.
$$\forall x\in\mathbb R\geq 5,x^2-x\geq 0$$
The **existential quantifier** $\exists$ indicates "there exists at least one".
$$\exists x\in S, P(x)$$
!!! example
There exists at least one real number greater than or equal to 5, defined as $x$, satisfies the condition $x^2-x\geq 0$.
$$\exists x\in\mathbb R\geq 5,x^2-x\geq 0$$
Quantifiers can also be negated and nested. The opposite of "for each ... that satisfies $P(x)$" is "there exists ... that does **not** satisfy $P(x)$".
$$\neg(\forall x\in S,P(x))\equiv\exists x\in S,\neg P(x)$$
Nested quantifiers are **evaluated in sequence**. If the quantifiers are the same, they can be grouped together per the commutative and/or associative laws.
$$\forall x\in\mathbb R,\forall y\in\mathbb R\equiv \forall x,y\in\mathbb R$$
!!! warning
This means that the order of the quantifiers is relevant if the quantifiers are different:
$\forall x\in\mathbb R,\exists y\in\mathbb R,x-y=1$ is **true** as setting $y$ to $x-1$ always fulfills the condition.
$\exists y\in\mathbb R,\forall x\in\mathbb R, x-y=1$ is **false** as when $x$ is selected first, it is impossible for every value of $y$ to satisfy the open sentence.
## Proof techniques
There are a variety of methods to prove or disprove statements.
- **Deduction**: a chain of logical inferences from a starting assumption to a conclusion
- **Case analysis**: exhausting all possible cases (e.g., truth table)
- **Contradiction**: assuming the conclusion is false, which follows that a core assumption is false, therefore the conclusion must be true
- **Contrapositive**: is equivalent to the original statement
- **Counterexample**: disproves things
- **Induction**: Prove for a small case, then prove that that applies for all cases
Implications can be proven in two simple steps:
1. It is assumed that the hypothesis is true (the implication is always true when it is false)
2. Proving that it follows that the conclusion is true
!!! example "Proving implications"
Prove that if $n+7$ is even, $n+2$ is odd.
$\text{Proof:}$
$\text{Assume }n+7\text{ is an even number. It follows that for some }k\in\mathbb Z$
$$
\begin{align*}
n+7&=2k \\
\text{s.t.} n+2&=2k-5 \\
&=2(k-3)+1
\end{align*}
$$
$\text{which is of the form }2z+1,z\in\mathbb Z,\text{ thus } n+2\text{ is odd.}$
!!! example "Proof by contradiction"
Prove that there is no greatest integer.
$\text{Proof:}$
$\text{ Let }n\in\mathbb Z\text{ be given and assume }\overbrace{\text{for the sake of contradiction}^\text{FTSOC}}\text{ that }n\text{ is the largest integer. Note that }n+1\in\mathbb Z\text{ and }n+1>n.\text{ This contradicts the initial assumption that }n\text{ is the largest integer, therefore there is no largest integer.}$
### Formal theorems
An **even number** is a multiple of two.
$$\boxed{n\ \text{is even}\iff\exists k\in\mathbb Z,n=2k}$$
An **odd number** is a multiple of two plus one.
$$\boxed{n\text{ is odd}\iff\exists k\in\mathbb Z,n=2k+1}$$
A number is **divisible** by another $m|n$ if it can be part of its product.
$$\boxed{n\text{ is divisible by } m\iff\exists k\in\mathbb Z,n=mk}$$
A number is a **perfect square** if it is the square of an integer.
$$n\text{ is a perfect square}\iff \exists k\in\mathbb Z,n=k^2$$
### Induction
!!! definition
- A proof **without loss of generality** (WLOG) indicates that the roles of variables do not matter — so long as the symbols CTRL-H'd, the proof remains exactly the same. For example, "WLOG, let $x,y\in\mathbb Z$ st. $x<y$."
Induction is a proof technique that can be used if the open sentence $P(n)$ depends on the parameter $n\in\mathbb N$. Because induction works in discrete steps, it generally cannot be applied domains of all real numbers.
To do so, the following must be proven:
- $P(1)$ must be true (the base case)
- $P(k+1)$ must be true for all $P(k)$, assuming $P(k)$ is true (the inductive case)
!!! warning
The statement **cannot** be assumed to be true, so one side must be derived into the other side.
!!! tip "Proof"
This should more or less be exactly followed. For the statement $\forall n\in\mathbb Z,n!>2^n$:
> We use mathematical induction on $n$, where $P(n)$ is the statement $n!>2^n$.
>
> **Base case**: Our base case is $P(4)$. Note that $4!=24>16=2^4$, so the base case holds.
>
> **Inductive step**: Let $k\geq 4$ for an arbitrary natural number and assume that $k!>2^k$. Multiplying by $k+1$ gives
>
> $$(k+1)k^2>(k+1)2^k$$
>
> By definition $(K=1)k!=(k+1)!$. Since $k\geq 4$, $k+1>2$ and thus $(k+1)2^k>2\cdot 2^k=2^{k+1}$. Putting this together gives
>
> $$(k+1)!>2^{k+1}$$
>
> Thus $P(k+1)$ is true and by the Principle of Mathematical Induction (POMI), $P(n)$ is true for all $n\geq 4$.
Induction can be applied to the whole set of integers by proving the following:
- $P(0)$
- if $i\geq 0, P(i)\implies P(i+1)$
- if $i\leq 0, P(i)\implies P(i-1)$
Alternatively, some steps can be skipped in **strong induction** by proving that if for $k\in\mathbb N$, $P(i)$ holds for all $i\leq k$, so $P(k+1)$ holds. In other words, by assuming that the statement is true for all values before $k$. If strong induction is true, regular induction must also be true, but not vice versa.
## Sets
!!! definition
- A **set** is an unordered collection of distinct objects.
- An **element/member** of a set is an object in that set.
- A **multiset** is an unordered collection of objects.
Sets are expressed with curly brackets:
$$\{s_1, s_2,\dots\}$$
Numbers are defined as sets of recursively empty sets:
$$
\begin{align*}
0&:=\empty \\
1&:=\{\empty\} \\
2&:=\{\empty,\{\empty\}\}
\end{align*}
$$
### Special sets
- $\mathbb N$ is the set of **natural numbers** $\{1, 2, 3,\dots\}$
- $\mathbb W$ is the set of **whole numbers** $\{0, 1, 2,\dots\}$
- $\mathbb Z$ is the set of **integers** $\{\dots, -1, 0, 1, \dots\}$
- $\mathbb Z^+_0$ is the set of **positive integers, including zero** — these modifiers can be applied to the set of negative integers and real numbers as well
- $2\mathbb Z$ is the set of **even integers**
- $2\mathbb Z + 1$ is the set of **odd integers**
- $\mathbb Q$ is the set of **rational numbers**
- $\mathbb R$ is the set of **real numbers**
- $\empty$ or $\{\}$ is the **empty set** with no elements
### Set builder notation
!!! definition
- The **domain of discourse** is the context of the current problem, which may limit the universal set (e.g., if only integers are discussed, the domain is integers only)
$x$ is an element if $x$ is in $\mathcal U$ and $P(x)$ is true.
$$\{x\in\mathcal U|P(x)\}$$
!!! example
All even numbers: $A=\{n\in\mathbb Z,\exists k\in\mathbb Z,n=2k\}$
$f(x)$ is an element if $x$ is in $\mathcal U$, and $P(x)$ is true:
$$\{f(x)|\underbrace{x\in\mathcal U, P(x)}_\text{swappable, omittable}\}$$
!!! example
- All even numbers: $A=\{2k|k\in\mathbb Z\}$
- All rational numbers: $\mathbb Q=\{\frac a b | a,b\in\mathbb Z,b\neq 0\}$
The **complement** of a set is the set containing every element **not** in the set.
$$\overline S$$
The **universal set** is the set containing everything, and is the complement of the empty set.
$$\mathcal U=\overline\empty$$
Two sets are **disjoint** if they do not have any elements in common.
$$S\cup T=\empty$$
### Set operations
A **subset** is inside another that is a **superset**.
$$
S\subseteq T \\
S\subseteq T\iff \forall x\in\mathcal U,(x\in S\implies x\in T)
$$
A **strict or proper subset** is a subset that is not equal to its **strict or proper superset**.
$$S\subset T$$
Two sets are equal if they are subsets of each other.
$$S=T\equiv (S\subseteq T)\wedge (T\subseteq S)$$
The **union** of two sets is the set that contains any element in either set.
$$S\cup T=\{x\in\mathcal U|(x\in S)\vee(x\in T)\}$$
The **intersection** of two sets is the set that only contains elements in both sets.
$$S\cap T=\{x\in\mathcal U|(x\in S)\wedge(x\in T)\}$$
The **difference** of two sets is the set that contains elements in the first but not the second. The remainder is dropped.
$$S-T=S\backslash T$$
The **complementary** set is every element not in that set.
$$
\overline S=\{x:x\not\in S\} \\
\overline S=\mathcal U-S
$$
The intersection and union operators have the same properties as **AND** and **OR** and so are equally commutative / associative.
**De Morgan's laws** still hold with sets.
### Intervals
An interval can be represented as a bounded set.
$$[a,b)=\{x\in\mathcal U|a\leq x\wedge x<b\}$$
$\empty$ is any impossible interval.
### Ordered pairs
!!! definition
- A **binary relation** on two sets $A, B$ is a subset of their Cartesian product.
- An ***n*-ary relation** between $n$ sets is a subset of their *n*-Cartesian product.
Also known as **tuples**, ordered pairs are represented by angle brackets.
$$\left<a,b\right> = \left<c,d\right>\iff (a=c)\wedge(b=d)$$
The **Cartesian product** of two sets is the set of all ordered pair combinations within the two sets.
$$A\times B=\{\left<a,b\right> | (a\in A)\wedge (b\in B)\}$$
It is effectively the cross product, so is not commutative, although distributing unions, intersections, and differences works as expected.
The **n-Cartesian product** of $n$ sets expands the Cartesian product.
$$A\times B\times\dots\times Z=\{\left<a, b,\dots z\right>|a\in A, b\in B,\dots,z\in Z\}$$
### Powersets
!!! definition
- An **index set** $I$ is the set containing all relevant indices.
A **partition** of a set $S$ is a set of **disjoint** sets that create the original set when unioned.
$$S=\bigcup_{i\in I}A_i$$
!!! example
$\{\{1\},\{2,3\},\{4,\dots\}\}$ is a partition of $\mathbb N$.
A **powerset** of a set $A$ is the set of all possible subsets of that set.
$$\mathcal P(A)=\{X|X\subseteq A\}$$
The empty set is the subset of every set so is part of each powerset. The number of elements in a subset is equal to the the number of elements in the original set as a power of two.
$$\dim(\mathcal P(A))=2^{\dim(A)}$$
!!! example
- $\mathcal P(\empty)=\empty$
- $\mathcal P(\{1,2\})=\{\empty, \{1\}, \{2\}, \{1, 2\}\}$
By definition, any subset is an element in the powerset.
$$A\subseteq B\equiv A\in\mathcal P(B)$$
- $\empty\in\mathcal P(A)$
- $A\in\mathcal P(A)$
- $A\subseteq B\implies (\mathcal P(A)\subseteq \mathcal P(B))$
- $A\in C\implies (C-A\subseteq C)$
!!! example
To prove $A\subseteq B\implies \mathcalP(A)\subseteq \mathcal P(B)$:
**Proof:** Let $A\subseteq B$ and $X\in\mathcal P(A)$. By definition, since $X\in\mathcal P(A), X\subseteq A$. Since $A\subseteq B$, it follows that $X\subseteq B$. Thus by the definition of the powerset, $X\in\mathcal P(B)$.
## Functions
!!! definition
- A **surjective** function has an equal codomain and range.
A **function** a relation between two sets $f:X\to Y$ such that each $x\in X$ **maps to** a unique $f(x)\in Y$.
$$
\begin{align*}
f:\ &X\to Y \\
&x\longmapsto f(x)
\end{align*}
$$
!!! example
Sample function with multiple cases and indices:
$$
\begin{align*}
f:\ &X\to Y \\
&x_i\longmapsto \begin{cases}
y_1 & i\in\{1,2\} \\
y_3 & i\in\{3,4,5\}
\end{cases}
\end{align*}
$$
The **domain** $\text{dom}(f)$ is the input set.
$$X=\text{dom}(f)$$
The **codomain** $\text{cod}(f)$ is the output set.
$$Y=\text{cod}(f)$$
The **range** $\text{rang}(f)$ is the subset of $Y$ that is actually mapped to by the domain.
$$
\begin{align*}
\text{rang}(f)&=\{y\in Y|\exists x\in X,y=f(x)\} \\
&=\{f(x)|x\in X\}
\end{align*}
$$
The **pre-image** is the subset of the domain that maps to a specific subset $B$ of the codomain.
$$\text{preimage}(f)=\{x\in X|\exists y\in B,y=f(x)\}$$
The **image** is the subset of the codomain that is mapped by a specific subset $A$ of the domain.
$$\text{image}(f)=\{f(x)|\exists x\in A\}$$
!!! example
For the function $f: \mathbb R^+_0\to \mathbb R$ defined by $x\longmapsto x^2$:
- the domain is $\mathbb R^+_0$
- the codomain is $\mathbb R$
- the range is $\mathbb R^+_0$
- the preimage for $\{1\}$ is $\{1,-1\}$
- the image for $0$ is $\{0\}$
Two functions $f=g$ are equal if and only if:
- their domains are equal
- their codomains are equal
- $f(x)=g(x)$ for all $x\in \text{dom}(f)$
### Function types
An **injective function**, **injection**, or **one-to-one function** is a function that maps only one $y$-value to each $x$.
$$\forall x_1,x_2\in\text{dom}(f), \text{ if } f(x_1)=f(x_2),x_1=x_2$$
A **surjective function**, **surjection**, or **onto** is a function that has its codomain equal to its range. A surjection $g:Y\to X$ exists if and only if an injection $f:X\to Y$ exists.
$$
\forall y\in\text{cod}(f),\exists x\in\text{dom}(f), f(x)=y \\
\text{rang}(f)=\text{cod}(f)
$$
A **bijective function** is both injective and surjective.
An **inverse relation** swaps the domain, codomain, and ordered pairs.
$$
\begin{align*{
R^{-1}:Y&\to X \\
R(x)&\mapsto x
$$
A function is **invective** or **invertible** if and only if it is bijective. All inversions are also bijective.
$$f^{-1^{-1}}=f$$
A **composition** maps the codomain of one to the domain of another function only if the first is a subset ($Y_1\subseteq Y_2$).
$$
\begin{align*}
f&:X\to Y_1,x\mapsto f(x) \\
g&:Y_2\to Z,y\mapsto g(y) \\
gf&: X\to Z,x\mapsto g(f(x))
\end{align*}
$$
Compositions are commutative but not associative.
- $h(gf)=(hg)f$
- $hgf\neq hfg$
- $f, g$ are injective $\implies$ $gf$ is injective
- $f, g$ are surjective $\implies$ $gf$ is surjective
- $gf$ is injective $\implies$ $f$ is injective
- $gf$ is surjective $\implies$ $g$ is surjective
The **identity function** is the function that returns its argument. Generally, a function composed with its inverse is the identity function.
$$
\begin{align*}
I:X&\to X \\
x&\mapsto x
\end{align*}
$$
If $f: X\to Y$ is bijective:
- the identity on $Y$ is $f(f^{-1}(y))$
- the identity on $X$ is $f^{-1}(f(x))$
If $f: X\to Y$ and $g: Y\to Z$ are bijective:
- $gf$ exists and is invertible
- $f^{-1}g^{-1}=(gf)^{-1}$ and exists
## Cardinality
!!! definition
- A **countably infinite** set is such that there exists a **bijective** function that maps the set to the set of natural numbers.
- A **countable** set is a finite set or a countably infinite set.
- An **uncountable** or **uncountably infinite** set is not countable.
The **cardinality** of a set is the number of elements in that set.
$$|S|$$
If two sets have a finite number of elements, their Cartesian product will have the same number of elements as the product of their elements.
$$|A|,|B|\in\mathbb N\implies|A\times B|=|A||B|$$
If two sets $X$ and $Y$ have finite cardinality and $f:X\to Y$:
- An injective function must have $|X|\leq |Y|$.
- A surjective function must have $|X|\geq |Y|$.
- A bijective function occurs if and only if $|X|=|Y|$.
A set is **finite** if it is empty or it is mappable to a subset of the natural numbers. By definition, the set of natural numbers is infinite.
$$\exists n\in\mathbb N,\exists f\text{ is bijective}, f:S\to \mathbb N_n,|s|=n$$
### Uncountable sets
The cardinality of countable sets is relative to the cardinality of the set of **natural numbers**.
$$|\mathbb N|=\aleph_0$$
By Contor's theorem, the powerset of the natural numbers must have a larger cardinality than the set of natural numbers.
$$|X|=\aleph_0\implies|\mathcal P(X)|=2^{\aleph_0}>\aleph_0$$
The following can be taken for granted:
- $|\mathbb R|>|\mathbb N|$
- $|\mathcal P(\mathbb N)|>|\mathbb N|$
- $|\mathcal P(\mathbb N)|=|\mathbb R|$
## Relations
A **binary relation** $R$ from sets $A$ to $B$ must be a subset of the two. A relation from $A$ to $A$ can be written as $R\subseteq A^2$.
$$R\subseteq A\times B$$.
!!! example
- $\forall x,y\in A,B,x<y$ is a subset. $<$ is a binary relation.
For $R\subseteq X\times Y$:
- $\text{dom}(R)=\{x\in X|\exists y\in Y,xRy\}$
- $\text{cod}(R)=Y$
- $\text{rang}(R)=\{y\in Y|\exists x\in X,xRy\}$
- The **image** of $X_1\subseteq X$ under $R$: $R(X_1)=\{y\in Y|\exists x\in X_1xRy\}$
- The **pre-image** is: $R^{-1}(Y_1)=\{x\in X|\exists y\in Y_1,xRy\}$
Relations are trivially proven to be relations through subset analysis.
!!! example
For the relation $L$\subseteq R^2=\{\left<x,y\right>\in\mathbb R^2|x<y\}$:
Clearly it is a subset of $R^2$, so it is a relation.
- The domain is $\mathbb R$.
- The range is $\mathbb R$.
- $L(\{1,4\})=\{y>4|y\in\mathbb R\}$ (1 OR 4)
- $L^{-1}(\{-1,2\})=\{x\in\mathbb R|x<2\}$ (-1 OR 2)
The **empty relation** $\empty$ is a relation on all sets.
The **identity relation** on all sets returns itself.
$$E=\{\left<a,a\right>|a\in A\}$$
The **universal relation** relates each element in the first set to every element to the second set.
$$U=A^2$$
The **restriction** of relation $R$ to set $B$ limits a previous relation on a superset $A$ such that $B\subseteq A$.
$$R\big|_B=R\cap B^2$$
Graphs are often used to represent relations. A node from $4\to3$ can be represented as $\left<3,4\right>$, much like an adjacency list.
### Reflexivity
A **reflexive** relation $R\subseteq X^2$ is such that every element in $X$ is related to itself by the relation.
$$\forall x\in X,\left<x,x\right>\in R$$
An **irreflexive** relation is such that each element is *not* related to itself.
$$\forall x\in X,\left<x,x\right>\not\in R$$
Reflexivity is determined graphically by checking if the main diagonal of a truth table is true.
!!! example
For the reflexive relation $R$, $A=\{1,2\},R=\{\left<1,1\right>,\left<2,2\right>\}$:
|$A\times A$ | 1 | 2 |
| --- | --- | --- |
| 1 | T | F |
| 2 | F | T |
!!! warning
$\empty$ is often vacuously true for most conditions.
If $R$ is a **non-empty** relation on a **non-empty** set $X$, $R$ cannot be both reflexive and irreflexive.
### Symmetry
A **symmetric** relation $R\subseteq X^2$ is such that every relation goes both ways.
$$\forall x,y\in X^2,\left<x,y\right>\in R\iff\left<y,x\right>\in R$$
An **asymmetric** relation is such that **no** relation goes both ways.
$$\forall x,y\in X^2,\left<x,y\right>\in R\implies\left<y,x\right>\not\in R$$
An **antisymmetric** relation is such that **no** relation goes both ways, *except* if compared to itself, and that the relation relates identical items.
$$\forall x,y\in X^2,\left<x,y\right>\in R\wedge\left<y,x\right>\in R\implies x=y$$
Where $x,y,z$ are elements in $X$, and $p,q,r$ are arbitrary proposition results (true/false):
- Symmetric relations must be symmetrical across the main diagonal of a truth table.
| $X^2$ | $x$ | $y$ | $z$ |
| --- | --- | --- | --- |
| $x$ | ? | $p$ | $q$ |
| $y$ | $\neg p$ | ? | $r$ |
| $z$ | $\neg q$ | $\neg r$ | ? |
- Asymmetric relations must be oppositely symmetrical across the main diagonal. The main diagonal also must be false.
- Antisymmetric relations must be false only if there is a true.
### Transitivity
A **transitive** relation links related terms. For example, $a<b$ and $b<c$ implies $a<c$.
$$\forall x,y,z\in X,\left<x,y\right>\in R\wedge\left<y,z\right>\in R\implies\left<x,z\right>\in R$$
## Orders
!!! definition
- A **partial order** is reflextive, antisymmetric, and transitive.
A **partially ordered set (poset)** is a set $S$ partially ordered with relation $R$.
$$\left<S,R\right>\text{ on } P=R_{S,P}$$
!!! example
$R_{\mathbb Z,\geq}$ is a poset. $\left<\mathcal P(A),\subseteq\right>$ on $A$ is also a poset.
A **strict poset** is irreflexive, asymmetric, and transitive.
A **total order** is a strict poset such that the relation is defined between every possible pair on the set.
$$\forall x,y\in S,xPy\wedge yPx\in\left<S,P\right>$$
### Equivalence relations
An **equivalence class** is a criterion that determines whether two objects are equivalent. The original set must be the union of all equivalence classes.
!!! example
The following are all in the equivalence class $=_1$: $\{1,\frac 2 2,\frac 3 3,\frac 4 4,...\right}$
## Combinatorics
!!! definition
- **and** usually requires you to multiply sets together.
- **or** usually requires you to add then subtract unions.
The number of ways to choose exactly one element from finite sets is the product of their dimensions.
$$|A_1||A_2|...|A_n|$$
!!! example
The number of unique combinations (including order) from four dice is $|6|^4$.
### Ordered with replacement
These problems count order as separate permutations and replace an item after it is taken for the future. If there are $n$ outcomes, and $m$ events that take one of those outcomes:
$$P=n^m$$
To pick $m$ items out of $n$ elements:
$$P(n,m)=\frac{n!}{(n-m!)}$$
If there are duplicates that would otherwise result in an identical string, divide the result by $m!$, where $m$ is the number of repetitions for each duplicate $n_1,n_2,...$.
$${n\choose n_1!n_2!n_k!}=\frac{n!}{n_1!n_2!...n_k!}$$
!!! example
The number of permutations of "ECE119" has two characters that have duplicates. Therefore, the number of possibilities is:
$$\frac{6!}{2!2!}$$
### Unordered with replacement
To rearrange $n$ unique items, the number of possibilities is:
$$n!$$
To choose $n$ items $m$ times, regardless of order, the number of possibilities is:
$${n\choose m}=\frac{n!}{(n-m)!m!}={n\choose(n-m),m}$$
Clearly ${n\choose m}=0$ if $m>n$ or $m<0$.
To choose $k$ out of $n$ items one time, multichoose can be used:
$$\left({n\choose k}\right)={n+k-1\choose k}={n-1+k\choose n-1,k}$$
### Binomial coefficients
A **slack variable** is used to change inequalities into equalities.
!!! example
If solving $x+y\leq 7$, setting $z=7-(x+y)$ to make everything the same domain ($\mathbb Z^+_0$) to use choose.
**Pascal's identity** defines the choose operator recursively.
$${n\choose m}={n-1\choose m-1}+{n-1\choose m}$$
The **binomial theorem** expands a binomial.
$$\forall a,b\in\mathbb R,(a+b)^n=\sum^n_{i=0}{n\choose i}a^{n-i}b^i$$
The sum of choosing integers is its power to 2. Therefore, a finite set with dimension $n$ must have exactly $2^n$ possible subsets.
$$\forall n\in\mathbb Z^+_0,\sum^n_{k=0}{n\choose k}=2^n$$
### Inclusion-exclusion
The inclusion-exclusion principle removes duplicate counting.
$$|A\cup B|=|A|+|B|-|A\cap B|$$
This can be extended to 3+ sets, proven by a bijection to $\mathbb N_{|A| + |B|+|A\cap B|}$:
$$|A\cup B\cup C|=|A| + |B| + |C| - (|A\cap B| + |A\cap C| + |B\cap C|)-|A\cap B\cap C|$$
If $B$ is a subset of $A$, the dimension of $B$ is related to that of $A$.
$$B\subseteq A\implies|B|=|A|-|\overline B|$$
## Probability
!!! definition
- An **experiment** is an event that has a number of outcomes.
- **Elementary events** are the outcomes of an experiment compose the set of all events.
- An **event** $E$ is a subset of the sample space $S$, which is the **certain event**.
- The **null event** is the empty set.
- Sets of events are **mutually exclusive** if they are disjoint.
- Elementary events are **equiprobable** if they are equally probable.
- A **uniform probability distribution** on $S$ is such that all elementary events are equiprobable.
A **probability distribution function (PDF)** $Pr$ converts the elements of the powerset of all outcomes to a real number — its probability.
$$Pr:\mathcal P(S)\to\mathbb R,0\leq P(A)\leq 1$$
A PDF must have, if $S$ is the sample space:
- $\forall A\subseteq S,Pr\{A\}\geq 0$
- $Pr\{S\}=1$
- The union of all mutually exclusive sets is the sample space
A **discrete probability distribution** is such that the sample space is a countable set.
For all $A\subseteq S$, the probability of event $A$ is the sum of the probabilities of all elementary events in $A$.
- $Pr\{A\}=\sum_{e\in A}Pr\{\{e\}\}$
- $Pr\{\empty\}=0$
- $Pr\{A'\}=1-Pr\{A\}$
Adding events together can never decrease their probability, and the sum of all probabilities must equal $1$ such that $\text{rang}(Pr)\subseteq[0,1]$.
$$A\subseteq B\subseteq S\implies Pr\{A\}\leq Pr\{B\}$$
The **inclusion-exclusion principle** also applies.
$$Pr\{A\cup B\}=Pr\{A\}+Pr\{B\}-Pr\{A\cup B\}$$
### Named PDFs
!!! definition
- An **emperical PDF** is collected from empirical data.
A **Bernouilli trial** is an event with exactly two options, pass $P$ with probability $p$, or fail $F$ with probability $q=1-p$. For the event $X$:
$$
Pr\{X\}=\begin{cases}
p &\text{if }X=\{P\} \\
1-p&\text{if }X=\{F\}
\end{cases}
$$
For exactly two options for $x$ (1 or 0):
$$Pr\{X=x\}=p^x(1-p)^{1-x}$$
Please see [SL Math - Analysis and Approaches 2#Binomial distribution](/g11/mcv4u7/#binomial-distribution) for more information.
A **random variable** is a function that assigns a real number to every item in the sample space. A **discrete random variable** is used if the sample space is discrete. The probability of all events that lead to a possible discrete random variable $x\in\mathbb R$, where $X$ is the function to transform those variables:
$$Pr\{X^{-1}(\{x\})\}$$
Thus the **binomial distribution** for $r$ successes of $n$ total tries, if they are independent, is:
$$Pr\{X=r\}{n\choose r}p^rq^{n-r}$$
### Independence
Please see [SL Math - Analysis and Approaches 2#Conditional probability](/g11/mcv4u7/#conditional-probability) for more information.
Two events are independent if they can be treated separately.
$$\text{independent}\iff Pr\{A\cap B\}=Pr\{A\}Pr\{B\}$$
Or, via the inclusion-exclusion theorem:
$$\text{independent}\iff Pr\{A\cup B\}=Pr\{A\}+Pr\{B\}-Pr\{A\}Pr\{B\}$$
**Bayes' theorem** provides a general formula for conditional probability:
$$Pr\{A|B\}=\frac{Pr\{B|A\}}{Pr\{B\}}$$
Formally, this can be solved without $Pr\{B\}$:
$$Pr\{A|B\}=\frac{Pr\{A\}Pr\{B|A\}}{Pr\{A\}Pr\{B|A\}+Pr\{\overline A\}Pr\{B|\overline A\}}$$
### Expected value
The **expected value**, **mean**, or **expectation of $X$** is:
$$E[X]=\sum_{x\in\mathbb R}x\cdot Pr\{X=x\}=\sum_{s\in S}X(s)\cdot Pr\{\{s\}\}$$
This operation is **linear**, but multiplies using AND:
$$
E[X+Y]=E[X}+E[Y] \\
E[XY]=\sum_{x\in X,y\in Y}xy\cdotPr\{X=x\wedge y\=y\}
$$
Thus if $X$ and $Y$ are independent:
$$E[XY]=E[X]E[Y]$$
An **indicator random variable** only has two possible outcomes: zero or one. Thus an indicator random variable $X$ has an expected value equal to its probability:
$$E[X]=Pr\{X=1\}$$
The **covariance** of $X$ and $Y$ represents the direction of difference of $X$ and $Y$ from their means.
$$Cov[X,Y]=E[XY]-E[X]E[Y]$$

View File

@ -1,591 +0,0 @@
# ECE 124: Digital Circuits
## Base / radix conversion
Please see [ECE 150: C++#Non-decimal numbers](/1a/ece150/#non-decimal numbers) for more information.
## Binary logic
A **binary logic variable** is a variable that has exactly two states:
- 0, or false (switch open)
- 1, or true (switch closed)
**Binary logic functions** are any function that satisfies the following type signature:
```python
BoolFunc = Callable[[bool | BoolFunc, ...], bool]
```
In other words:
- it must accept a number of booleans and/or other logic functions, and
- it must return exactly one boolean.
These can be expressed via truth table inputs/outputs, algebraically, or via a logical circuit schematic.
### Logical operators
Operator precedence is () > NOT > AND > OR.
The **AND** operator returns true if and only if **all** arguments are true.
$$A\cdot B \text{ or }AB$$
<img src="https://upload.wikimedia.org/wikipedia/commons/b/b9/AND_ANSI_Labelled.svg" width=200>(Source: Wikimedia Commons)
The **OR** operator returns true if and only if **at least one** argument is true.
$$A+B$$
<img src="https://upload.wikimedia.org/wikipedia/commons/1/16/OR_ANSI_Labelled.svg" width=200>(Source: Wikimedia Commons)</img>
The **NOT** operator returns the opposite of its singular input.
$$\overline A \text{ or } A'$$
<img src="https://upload.wikimedia.org/wikipedia/commons/6/60/NOT_ANSI_Labelled.svg" width=200>(Source: Wikimedia Commons)</img>
The **NAND** operator is equivalent to **NOT AND**.
$$\overline{A\cdot B}$$
<img src="https://upload.wikimedia.org/wikipedia/commons/e/e6/NAND_ANSI_Labelled.svg" width=200>(Source: Wikimedia Commons)</img>
The **NOR** operator is equivalent to **NOT OR**.
$$\overline{A+B}$$
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c6/NOR_ANSI_Labelled.svg" width=200>(Source: Wikimedia Commons)</img>
The **XOR** operator returns true if and only if the inputs are not equal to each other.
$$A\oplus B$$
<img src="https://upload.wikimedia.org/wikipedia/commons/1/17/XOR_ANSI_Labelled.svg" width=200>(Source: Wikimedia Commons)</img>
The **XNOR** operator is equivalent to **NOT XOR**.
$$\overline{A\oplus B}$$
<img src="https://upload.wikimedia.org/wikipedia/commons/b/b8/XNOR_ANSI_Labelled.svg" width=200>(Source: Wikimedia Commons)</img>
### Buffer gates
The **buffer** gate returns the input without any changes, and is usually used for adding delays into circuits.
<img src="https://upload.wikimedia.org/wikipedia/commons/7/75/Digital_buffer.svg" width=200>(Source: Wikimedia Commons</img>
A **tri-state buffer** gate controls whether the input affects the circuit at all. When the controlling input is off, the input is disconnected from the rest of the system, leaving the output of the buffer as a third state **Z** (high impedance).
One example of a tri-state buffer is a switch.
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c0/Tristate_buffer.svg" width=400>(Source: Wikimedia Commons)</img>
!!! example
Tri-state buffers are often used to implement **select inputs** or **multiplexers** — setting the mux switch in one direction or another only allows signals from one input to pass through.
<img src="https://upload.wikimedia.org/wikipedia/commons/1/16/Multiplexer2.svg" width=400>(Source: Wikimedia Commons)</img>
### NAND/NOR completeness
NAND and NOR are **universal gates** — some combination of them can form any other logic gate. Constructions of other gates using only these gates are called **NAND-NAND realisations** or **NOR-NOR realisations**.
This is useful in SOP as if two ANDs feed into an OR, all can be turned into NANDs to achieve the same result.
!!! example
NOT can be expressed purely with NAND as $A$ NAND $A$:
<img src="https://upload.wikimedia.org/wikipedia/commons/3/3f/NOT_from_NAND.svg" width=150>(Source: Wikimedia Commons)</img>
### Postulates
In binary algebra, if $x,y,z\in\mathbb B$ such that $\mathbb B=\{0, 1\}$:
The **identity element** for **AND** $1$ is such that any $x\cdot 1 = x$.
The **identity element** for **OR** $0$ is such that any $x + 0 = x$.
In this space, it can be deduced that $x+x'=1$ and $x\cdot x'=0$.
**De Morgan's laws** are much easier to express in boolean algebra, and denote distributing a negation by flipping the operator:
$$
(x\cdot y)'=x'+y' \\
(x+y)=x'\cdot y'
$$
Please see [ECE 108: Discrete Math 1#Operator laws](/1b/ece108/#operator-laws) for more information.
AND and OR are commutative.
- $x\cdot y=y\cdot x$
- $x+y=y+x$
AND and OR are associative.
- $x\cdot(y\cdot z)=(x\cdot y)\cdot z)$
- ...
AND and OR are distributive with each other.
- $x\cdot (y+z)=x\cdot y+z\cdot z$
A term that depends on another term ORed together can be "absorbed".
- $x+x\cdot y=x$
- $x\cdot(x+y)=x$
If a term being true also results in other ORed terms being true, it is redundant and can be eliminated via consensus.
- $x\cdot y+y\cdot z+x'\cdot z=x\cdot y+x'\cdot z$
- if y and z are true, at least one of the other two terms must be true
- $(x+y)\cdot (y+z)\cdot(x'+z)=(x+y)\cdot (x'+z)$
The **synthesis** of an algebraic formula represents its implementation via logic gates. In this course, its total cost is the sum of all inputs to all gates and the number of gates, *excluding* initial inputs of "true" or an initial negation.
In order to deduce an algebraic expression from a truth table, **OR** all of the rows in which the function returns true and simplify.
??? example
Prove that $(x+y)\cdot(x+y')=x$:
\begin{align*}
\tag{distributive property}(x+y)\cdot(x+y')&=xx+xy'+yx+yy' \\
\tag{$yy'$ = 0, $xx=x$}&=x + xy' + yx \\
\tag{distributive, commutative properties}&= x(1+y'+y) \\
\tag{1 + ... = 1}&= x(1) \\
&=x
\end{align*}
Prove that $xy+yz+x'z=xy+x'z$:
\begin{align*}
\tag{$x+x'=1$}xy+yz+x'z&=xy+yz(x+x')+x'z \\
\tag{distributive property}&=xy+xyz+x'yz+x'z \\
\tag{distributive property}&=x(y+yz) + x'(yz+z) \\
\tag{distributive property}&=xy(1+z) + x'z(y+1) \\
\tag{$1+k=1$}&=xy(1) + x'z(1) \\
\tag{$1\cdot k=k$}&= xy+x'z
\end{align*}
### Minterms and maxterms
The **minterm** $m$ is a **product** term where all variables in the function appear once. There are $2^n$ minterms for each function, where $n$ is the number of input variables.
To determine the relevant function, the subscript can be converted to binary and each function variable set such that:
- if the digit is $1$, the complement is used, and
- if the digit is $0$, the original is used.
$$m_j=x_1+x_2+\dots x_n$$
!!! example
For a function that accepts three variables:
- there are eight minterms, from $m_0$ to $m_7$.
- the sixth minterm $m_6=xyz'$ because $6=0b110$.
For a sample function defined by the following minterms:
$$
\begin{align*}
f(x_1,x_2,x_3)&=\sum m(1,2,5) \\
&=m_1+m_2+m_5 \\
&=x_1x_2x_3' + x_1x_2'x_3 + x_1'x_2x_3'
\end{align*}
$$
The **maxterm** $M$ is a **sum** term where all variables in the function appear once. It is more or less the same as a minterm, except the condition for each variable is **reversed** (i.e., $0$ indicates the complement).
$$M_j=x_1+x_2+\dots +x_n$$
!!! example
For a sample function defined by the following maxterms:
\begin{align*}
f(x_1,x_2,x_3,x_4)&=\prod M(1,2,8,12) \\
&=M_1M_2M_8M_{12} \\
\end{align*}
??? example
Prove that $\sum m(1,2,3,4,5,6,7)=x_1+x_2+x_3$: **(some shortcuts taken for visual clarity)**
\begin{align*}
\sum m(1,2,3,4,5,6,7) &=001+011+111+010+110+100+000 \\
\tag{SIMD distribution}&=001+010+100 \\
&=x_1+x_2+x_3
\end{align*}
A **canonical sum of products (SOP)** is a function expressed as a sum of minterms.
$$f(x_1,x_2,\dots)=\sum m(a,b, \dots)$$
A **canonical product of sums (POS)** is a function expressed as a product of maxterms.
$$f(x_1,x_2,\dots)=\prod M(a,b,\dots)$$
## Transistors
Binary is represented in hardware via switches called **transistors**. Above a certain voltage threshold, its output is $1$, whlie it is $0$ if below a threshold instead.
A transistor has three inputs/outputs:
- A ground
- An input **source**, which has voltage that determines whether the circuit is connected to the ground
- An output **drain**, which will either be grounded or have a voltage depending on whether the switch is closed.
<img src="https://upload.wikimedia.org/wikipedia/commons/6/61/IGFET_N-Ch_Enh_Labelled_simplified.svg" width=200>(Source: Wikimedia Commons)</img>
A **negative logic** transistor uses a NOT bubble to represent that it is closed while the voltage is **below** a threshold.
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c4/IGFET_P-Ch_Enh_Labelled_simplified.svg" width=200>(Source: Wikimedia Commons)</img>
## Hardware
!!! definition
- A **programmable logic gate** does shit
- A **programmable logic array** does more shit
- **Programmable array logic** is the shit being done
### FPGAs
A **field-programmable gate array** (FPGA) is hardware that does not come with factory-fabricated AND and OR gates, requiring the user to set them up themselves. It contains:
- input/output pads
- routing channels (to connect with physical wires and switches)
- logic blocks (that are user-programmed to behave like gates)
- lookup tables (LUTs) inside the logic gates, which are a small amount of memory
## Gray code
The Gray code is a binary number system that has any two adjacent numbers differing by **exactly one bit**. It is used to optimise the number of gates in a function.
The 1-bit Gray code is $0, 1$. To convert an $n$-bit Gray code to an $n+1$-bit Gray code:
- Mirror the code: $0,1,1,0$
- Add $0$ to the original and $1$ to the new ones: $00, 01, 11, 10$
Sorting truth table inputs in the order of the Gray code makes optimisation easier to do.
A **"don't care"** is represented by a $d$ in truth tables. It is used for optimisation if the state of that output doesn't matter, and can be treated as a one or a zero as desired.
It can be more efficient to optimise two different functions differently such that they are more optimised when combined.
### K-maps
Karnaugh maps are an alternate representation of truth tables arranged by the Gray code.
- Coordinates are the input values to the function
- The output square of the coordinates is the output value of the function
- Headers are sorted by Gray code (multiple variables can be combined by increasing the number of bits in the Gray code)
Each 1 square is effectively a minterm, and finding the least number of rectangles that only cover "1"s allows for the simplest algebraic form of the truth table to be deduced. If needed, rectangles can wrap around on any side. The same rules apply to optimise for maxterms (product of sums), or $f'$, by optimising for zeros.
<img src="https://upload.wikimedia.org/wikipedia/commons/b/b7/K-map_6%2C8%2C9%2C10%2C11%2C12%2C13%2C14.svg" width=500>(Source: Wikimedia Commons)</img>
A K-map for five variables can be expressed in two maps for four variables — one with the fifth variable set to zero, and the other set to 1.
### Multiplexers
An $n$-input mux has $\lceil\log_2 n\rceil$ **select inputs** all in the same mux.
!!! example
A 4-1 multiplexer. $f=s_0's_1A+s_0's_1B+s_0s_1'C+s_0s_1D$
<img src="https://upload.wikimedia.org/wikipedia/commons/7/75/Multiplexer_4-to-1.svg" width=300>(Source: Wikimedia Commons)</img>
**Shannon's expansion theorem** states that any function can be turned into a function that purely uses multiplexers:
$$
\begin{align*}
f(w_1,\dots, w_n) &=w_1f_{w_1} + w_1'f_{w_1'} \\
&= w_1f(1, \dots, w_n) = w_1'f(0, \dots, w_n)
\end{align*}
$$
A **demultiplexer** has one input, $n$ select inputs, and up to $2^n$ outputs that carry the input signal depending on the select input.
<img src="https://upload.wikimedia.org/wikipedia/commons/4/48/Demultiplexer.png" width=400>(Source: Wikimedia Commons)</img>
A **binary encoder** takes $2^n$ inputs and $n$ outputs, with the binary representation of the $n$ outputs indicating the inputs enabled by binary index.
## Sequential circuits
!!! definition
- A **combinatorial circuit** is dependent on present signals.
- A **sequential circuit** is dependent on past and present signals, using storage elements to track state.
**Synchronous** sequential circuits only change signals at discrete times, such as with clock signals. Asynchronous circuits change whenever.
### Clocks
!!! definition
- The **period** $t$ is the duration of one clock cycle.
- The **frequency** $f$ is the reciprocal of the period.
- The **rising edge** is the instant a clock changes from $0$ to $1$.
- The **falling edge** is the instant a clock changes from $1$ to $0$.
### Storage elements
A **basic latch** changes based on its input signal level such that it is level-sensitive.
A **gated latch** is a basic latch as well as a control input that locks the current state. The latch is only togglable when the control input is on.
A **flip-flop** contains two gated latches and a control input. The state is only adjustable during the edges of the control signal, so it can only change up to once per cycle.
### Asynchronous latches
An **RS-NOR** basic latch has a *set* input that must be *reset* before being set again, with one output representing each state. Setting both to one resets both outputs to zero.
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c6/R-S_mk2.gif" width=300>(Source: Wikimedia Commons)</img>
| $R$ | $S$ | $Q$ | $Q'$ |
| --- | --- | --- | --- |
| 0 | 0 | no change | no change |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 0 |
An **RS-NAND** basic latch operates the same way, and looks practically the same, except shifting to $(1, 1)$ resets both to zero instead, and $(0, 0)$ causes no change.
### Synchronous latches
A **NAND gated latch** only allows changes when the clock control input *clk* is on.
<img src="https://upload.wikimedia.org/wikipedia/commons/e/e1/SR_%28Clocked%29_Flip-flop_Diagram.svg" width=400>(Source: Wikimedia Commons)</img>
A **gated D latch** effectively stores $R$ and $S$ by assuming that they are the complement for each other, setting $R$ as $D$ and $S$ as $D'$ or vice versa. This **level-sensitive** latch is commonly used to store past state as there is no change when *clk* is zero.
<img src="https://upload.wikimedia.org/wikipedia/commons/c/cb/D-type_Transparent_Latch_%28NOR%29.svg" width=400>(Source: Wikimedia Commons)</img>
### Flip-flops
**Edge-triggered flip-flops** only change state on the edge of a clock. A negative-edge D flip flop below changes only at the **falling edge** of the clock and is greated with two gated D latches in series. A positive-edge D flip flop can be created by inverting both enable inputs.
<img src="https://upload.wikimedia.org/wikipedia/commons/5/52/Negative-edge_triggered_master_slave_D_flip-flop.svg" width=500>(Source: Wikimedia Commons)</img>
The asynchronous operations **clear** and **preset** can be added to force the state of the flip-flop to 0 or 1, respectively. To make them synchronous, the input $D$ can be replaced with $D\text{ and clear}'$. These operations are **active low**.
<img src="https://upload.wikimedia.org/wikipedia/commons/8/8c/D-Type_Flip-flop.svg" width=200>(Source: Wikimedia Commons</img>
A **T flip-flop** holds state if $T=0$ or **toggles** state if $T=1$.
<img src="https://upload.wikimedia.org/wikipedia/commons/a/a9/T-Type_Flip-flop.svg" width=200>(Source: Wikimedia Commons</img>
!!! example
<img src="https://upload.wikimedia.org/wikipedia/commons/3/3b/Dual-edge-triggered-flip-flop-XOR.png" width=500>(Source: Wikimedia Commons)</img>
A **JK flip-flop** acts as a **D flip-flop** if $J\neq K$ and as a **T flip-flop** if $J=K$.
<img src="https://upload.wikimedia.org/wikipedia/commons/3/37/JK_Flip-flop_%28Simple%29_Symbol.svg" width=200>(Source: Wikimedia Commons)</img>
### Timing analysis
Because flip-flop outputs only change on an active clock edge, there are **propagation delays** before the state changes completely.
- The **setup time** $t_{su}$ is the waiting time the input must be held stable **before** the active clock edge
- The **hold time** $t_h$ is the time the input must be held stable **after** the active clock edge
- The **clock-to-output time** $t_{cq}$ is the time required for the output to stabilise after the active clock edge
A **timing violation** occurs if these timing parameters are not met, which limits clock cycle frequency.
### Registers
!!! definition
- An **n-bit register** stores *n* bits.
A flip-flop is a one-bit register.
A **shift register** is a chain of redstone repeaters, consisting of a chain of flip-flops with each output connected to the next input.
<img src="https://upload.wikimedia.org/wikipedia/commons/4/45/4-Bit_SIPO_Shift_Register.svg" width=300>(Source: Wikimedia Commons)</img>
An **up-counter** increments its binary value on input. A **down-counter** decrements its value. It is **synchronous** if all bits update simultaneously.
### Counters
A **Johnson counter** overflows by connecting the complement of the final output to the first input.
A **ring counter** has exactly one output bit equal to one, looping when it reaches the end. It is equivalent to a loop of redstone repeaters, if redstone repeaters required input to switch to the next repeater.
## Synchronous sequential circuits
A **synchronous sequential circuit** or **state machine** is created with a combinational circuit and a flip-flop.
A **state diagram** is a directed graph with nodes and arcs. Each node represents a state while arcs represent changes in input/output to other states. A circuit with $n$ inputs has $2^n$ arcs.
!!! example
A state diagram for a turnstile.
<img src="https://upload.wikimedia.org/wikipedia/commons/9/9e/Turnstile_state_machine_colored.svg" width=300>(Source: Wikimedia Commons)</img>
A **state table** is a simplified state diagram.
!!! example
Where $A,B,C$ are states, and $w$ is the input, a Moore machine can be represented as:
| state | next state | | output |
| --- | --- | --- | --- |
| | $w=0$ | $w=1$ | |
| A | A | B | 0 |
| B | A | C | 0 |
| C | A | C | 1 |
To design a state circuit:
1. Create a state diagram, select starting state
2. Minimise the number of states
3. Decide the number of state variables
4. Choose flip-flop types and derive next state logic expressions to control flip-flops
5. Derive logic expressions
6. Implement the logic expressions
### Moore machine
A Moore machine changes state **only** on the positive edge of the clock. Its output is true only if the previous two inputs were true.
State variables are usually tracked with flip-flops. These can be done with flip-flops treated as binary indexes for each state or with **one hot state** such that one state is tracked with one flip-flop.
### Mealy machine
A Mealy machine changes state **asynchronously**. Its output is true only if the current and past inputs are true.
| state | $w=0$ | $w=1$ | output |
| --- | --- | --- | --- |
| A | A | B | 0 |
| B | A | B | 1 |
### Minimising state
An **equivalent state** is such that each input has the same output and an equivalent next state. Reducing the number of redundant equivalent states minimises the number of states needed.
1. Group states by outputs
2. For each state, if not all states transition to the same group, subgroup them such that they do
3. Repeat as necessary
## Asynchronous sequential circuits
ASCs hae no clocks, relying on feedback from outputs for their memory effect.
!!! warning
ASCs break down if any of these assumptions fail.
- Only one input is allowed to change at a time
- Inputs change only after the circuit stabilises
- There is no propagation delay, although it may be compensated for with a delay element for the output / feedback
### Analysis
1. Determine logic expressions for next state and output in terms of current state and input
2. Create transition and flow tables
3. Circle stable states (will lead to itself)
4. Replace bits with letters
5. Assign bit variables to avoid changing more than one input at a time (as it is undefined)
To create a circuit:
1. Create a state diagram
2. Flow table
3. Minimise state
4. Excitation table
5. Circuit
### Reducing state
1. Partition per [#Minimising state](#minimising-state)
- *don't cares* are no longer equivalent unless both states have them in the same columns
2. States are compatible if and only if, regardless of input:
- their output is the same
- their next state is the same, is stable, or are unspecified
3. Merger diagram, identifying conflicts/compatible pairs
4. Connect diagram, merging a subset (not all) of compatible states
- states can only be in at most one subset
5. Repeat
### Avoiding races
!!! definition
- **Non-critical races** result in the same stable end state.
- **Critical races** cause *problems*.
- A **hazard** is unwanted switching due to unequal propagation delays.
To avoid races: an $n$-dimensional cube with one vertex per state, ensuring that changes only move along one edge. If more states are needed to avoid this, they are automagically *unstable*.
Alternatively, if $n\leq 4$, a state $A$ can be split into equivalent states $A1, A2$.
1. Create a cube with $2n$ vertices
2. Pairs must be adjacent
3. Determine next states by following cube lines only
Alternatively, each state can be assigned exactly one `1` bit, and transitions from one to another have `1`s at the states they transition between.
### Hazards
**Static-1/0 hazards** occur when output should stay constant, but suddenly flickers to the other. These can be fixed by covering minterms adjacent but not connected with another gate as an extra check.
**Dynamic hazards** occur when outputs flip multiple times before stabilising. These can be avoided by switching everything to 2-term POS or SOP and fixing static hazards.
## Multilevel synthesis
!!! definition
- A **literal** is an input character.
- An **implicant** is a collection of inputs that results in a true output.
- A **prime implicant** is such that no literals can be removed while remaining an implicant.
- A **cover** is a set of implicants that cover every possible way $f=1$.
- An **essential prime implicant** is such that there is no other prime implicant that fulfill a necessary condition to make $f$ true.
TO reduce fan-in, multi-input ANDs and ORs can be broken up to multiple versions of their nested form via **factoring**.
$$abcde\to(abc)(de)$$
**Functional decomposition** takes common terms and only calculates them first before feeding that input into the rest of the circuit.
### Tabular method
Cost is minimised when all essential prime implicants are present and the fewest number of prime implicants for the remaining terms.
1. List minterms, group by the number of ones in binary (don't cares can be treated as minterms)
2. Write the implicant for each
3. For each group, if an implicant differs by one bit from an implicant in the group above, merge them (replacing the distinctive term with $x$) and check that minterm / implicant off
4. Repeat, ensuring that $x$ only merges with $x$ in the same columns
Implicants not checked off are prime implicants.
1. List all primes and the minterms they cover as a table, excluding don't cares
- Minterms with only one prime have that as an essential prime
2. Primes that cover the same minterms as another but also more are objectively better (**row dominance**)
3. Make educated guesses to minimise prime implicants
Alternatively, instead of removing **dominated rows**, **dominatING columns** can be removed instead.
### Petrick method
Once reduced to tablular form:
1. For each column, sum all the possible ways a minterm can be covered, then product those sums
2. Expand and simplify, then choose the products with the least number of literals
3. Each product is a solution if you replace the product with a sum of the multiplied literals instead
## VHDL
VHDL is a hardware schematic language.
<img src="https://static.javatpoint.com/tutorial/digital-electronics/images/multiplexer3.png" width=600 />
For example, the basic 2-to-1 multiplexer expressed above can be programmed as:
```vhdl
entity two_one_mux is
port (a0, s, a1 : in bit;
f : out bit);
end two_one_mux
architecture LogicFunc of two_one_mux is
begin
y <= (a0 AND s) OR (NOT s AND a1);
end LogicFunc;
```
In this case, the inputs are `a0, s, a1` that lead to an output `y`. All input/output is of type `bit` (a boolean).
The **architecture** defines how inputs translate to outputs via functions. These all run **concurrently**.

View File

@ -1,511 +0,0 @@
# ECE 140: Linear Circuits
## Voltage, current, and resistance
Please see [SL Physics 1#Electric potential](/g11/sph3u7#electric-potential) for more information on voltage.
Please see [SL Physics 1#5.2 - Heating effect of electric currents](/g11/sph3u7/#52-heating-effect-of-electric-currents) for more information on current.
Please see [SL Physics 1#Resistance](/g11/sph3u7/#resistance) for more information on resistance.
**Electric charge** $Q$ quantises the charge of electrons and positive ions, and is expressed in coulombs (**C**).
Objects with charge generate electric fields, thus granting potential energy that is released upon proximity to another charge.
!!! warning
Voltage and current are capitalised in **direct current only** ($V$, $I$). In general use, their lowercase forms should be used instead ($v, $i$).
**Voltage** is related to the change in energy ($dw$) over the change in charge ($dq$), or alternatively through Ohm's law:
$$i=\frac{dw}{dq}=\frac{i}{R}$$
**Current** represents the rate of flow of charge in amps (**A**). Conventional current moves opposite electron flow because old scientists couldn't figure it out properly.
$$i=\frac{dq}{dt}\approx \frac{\Delta q}{\Delta t}$$
### Power
Power represents the rate of doing work, in unit watts ($\pu W$, \pu{J/s})
$$P=\frac{dw}{dt}$$
It is also directly related to voltage and current:
$$P=vi$$
Much like relative velocity, power is directional and relative, with a positive sign indicating the direction of conventional current.
$$P_{CB}=-P_{BC}$$
In a closed system, conservation of energy applies:
$$\sum P_\text{in}=\sum P_\text{out}$$
The **ground** is the "absolute zero" voltage with a maximum potential difference. It is also known as the "reference voltage".
### Independent energy sources
!!! definition
- A **ground** is the reference point that all **potential differences are relative to**.
A **generic voltage source** provides a known potential difference between its two terminals that is defined by the source. The resultant current can be calculated.
<img src="https://upload.wikimedia.org/wikipedia/commons/f/ff/Voltage_Source.svg" width=100>(Source: Wikimedia Commons)</img>
A **generic current source** provides a known amperage between its two terminals that is defined by the source. The resultant voltage can be calculated.
<img src="https://upload.wikimedia.org/wikipedia/commons/b/b2/Current_Source.svg" width=100>(Source: Wikimedia Commons)</img>
!!! tip
A current in the **positive direction** indicates that the source is releasing power (is a source). Otherwise, it is consuming power (is a load).
### Dependent energy sources
A **dependent <&ZeroWidthSpace;T: voltage | current> source** has a **T** dependent on the voltage or current elsewhere in the circuit. $k$ is a function that is likely but not guaranteed to be linear.
$$
v=kv_0\ |\ ki_0 \\
i=kv_0\ |\ ki_0
$$
<img src="https://upload.wikimedia.org/wikipedia/commons/5/55/Voltage_Source_%28Controlled%29.svg" width=100>(Source: Wikimedia Commons)</img>
<img src="https://upload.wikimedia.org/wikipedia/commons/f/fe/Current_Source_%28Controlled%29.svg" width=100>(Source: Wikimedia Commons)</img>
### Applications
A **cathode ray tube** produces an electron beam of variable intensity depending on the input signal. Electrons are deflected by the screen to produce imagery.
<img src="/resources/images/crt.png" />
### Resistance
A **resistor** *always absorbs power*, so must be oriented such that current goes into the positive sign.
According to Ohm's law, the voltage, current, and resistance are related:
$$v=iR$$
The **conductance** of a resistor is the inverse of its resistance, and is expressed in siemens ($\pu{S}$)
$$G=\frac 1 R = \frac I V$$
Therefore, power can be expressed by manipulating the equations:
$$
\begin{align*}
P &= IR^2 \\
&= V^2G \\
&= \frac{V^2}{R}
\end{align*}
$$
## Kirchhoff's laws
!!! definition
- A **node** is any point in the circuit to which 3+ elements are *directly* connected (i.e., all junctions).
- A **supernode** is any connected group in the circuit to which 3+ elements are *directly* connected.
- A **loop** is any closed path of elements.
Kirchhoff's **current law** states that the sum of all current entering a node must be zero, where positive indicates current entrance.
$$\sum i_\text{entering node}=0$$
Kirchoff's **voltage law** states that the sum of all voltage in a **closed loop** must be zero.
$$\sum v_\text{loop}=0$$
### Nodal analysis
Nodal analysis uses the voltages at the **nodes** instead of elements to calculate things in a three-step process:
1. Determine a reference node with $v=0$ and stick a ground out of that node.
2. Use KCL and Ohm's law on non-reference nodes to get their currents in terms of the reference node.
3. Solve the system of equations with the formula below.
On either side of a resistor, the current flowing that entire segment can be determined via the following formula:
$$i=\frac{v_\text{higher}-v_\text{lower}}{R}$$
### Mesh analysis
!!! definition
- A **mesh** is a loop with no inner loops.
- A **supermesh** is a combination of multiple meshes that share a common current source.
Mesh / loop analysis is used to determine unknown currents, using KVL instead of KCL to create a system of equations.
1. Assign mesh currents to each loop.
2. Use KVL and Ohm's law to get voltages in terms of mesh currents.
3. Solve the system of equations.
It may be easier to delete the branch of the current source in supermeshes, treating the region as one mesh with multiple mesh currents.
## Linearity
Circuits are linear if and only if their voltages, resistances, and currents can be expressed in terms of linear transformations of one another. They contain only linear loads, linear dependent sources, and independent souces.
$$\text{output}\propto\text{input}+C$$
!!! example
Halving voltage must halve current (or at least halve it relative to a base current / voltage).
### Superposition
In linear circuits, the superposition principle states that the voltage/current through an element is equal to the sum of the voltages/currents from each independent source alone.
$$
v=\sum v_x \\
i=\sum i_x
$$
To do so, each unused independent source should be replaced with a short circuit (voltage) or an open circuit (current).
### Source transformation
In linear circuits, a voltage source in series with a resistor can be replaced by a current source in parallel to that resistor (or vice versa), so long as Ohm's law is followed for the replacement:
$$v_1=i_2R$$
The arrow of the current source must point in the positive direction of the voltage source. This can also be used with dependent sources.
### Thevenin's theorem
Any part of a circuit including an independent source can be replaced with exactly one voltage source and a resistor in series. Two circuits are **Thevenin equivalent** if their $\lambda$ are equal in $V=\lambda I$.
If there are no dependent sources, all independent sources should be removed to determine the resistance across points $AB$:
$$R_{Th}=R_{AB}$$
Otherwise, $V_{AB}$ and $I_{AB}$ should be found by repeating these steps:
1. Cut off the load (open if finding voltage, short if finding current)
- If dependent sources depend on elements inside the load branch, zero them
2. Use analysis to determine the desired quantity
Across the load:
$$
I_L=\frac{V_{Th}}{R_{Th}+R_L} \\
V_L=R_LI_L = \frac{R_L}{R_{Th}+R_L}V_{Th}
$$
!!! warning
A negative resistance $R_{L}$ indicates that the load supplies power.
### Maximum power transfer
To maximise the power transferred from the circuit to the load, $R_L$ should be equal to $R_{Th}$.
$$P_L=v_Li_L$$
## Operational amplifiers
The entire op-amp follows KCL. The output current is the sum of all input currents (the two inputs and V+, V-).
Where $\Delta V$ is the difference between the two inputs, and $A$ is the gain of the opamp:
$$\boxed{V_{out}=A\Delta V}$$
Output voltage is limited by the maximum/minimum of the power supply $V_cc$.
If the output is fed directly into the inverting input (as a **voltage follower**), the gain is ignored and results in $V_{out}=\Delta V$.
An **ideal opamp** has no input current and equal voltages entering the opamp.
$$
\boxed{i_1=i_2=0} \\
\boxed{v_1=v_2}
$$
**Inverting amplifiers** feed their input back and return negative voltage.
$$V_{out}=-\frac{R_f}{R_i}V_{in}$$
<img src="https://upload.wikimedia.org/wikipedia/commons/4/41/Op-Amp_Inverting_Amplifier.svg" width=700>(Source: Wikimedia Commons)</img>
**Non-inverting amplifiers** moves the voltage source to the non-inverting terminal.
$$v_o=\left(1+\frac{R_f}{R_i}v_i\right)$$
<img src="https://upload.wikimedia.org/wikipedia/commons/6/66/Operational_amplifier_noninverting.svg" width=700>(Source: Wikimedia Commons)</img>
**Voltage followers** have either $R_f=0$ or $R_i=\infty$, so:
$$v_o=v_i$$
<img src="https://upload.wikimedia.org/wikipedia/commons/f/f7/Op-Amp_Unity-Gain_Buffer.svg" width=700>(Source: Wikimedia Commons)</img>
A **summing amplifier** splits an inverting amplifier's input into multiple voltage sources in series with resistances, all parallelised into the opamp:
$$v_o=-R_f\left(\frac{V_1}{R_1}+\frac{V_2}{R_2}+\frac{V_3}{R_3}\right)$$
<img src="https://upload.wikimedia.org/wikipedia/commons/3/3e/Op-Amp_Summing_Amplifier.svg" width=700>(Source: Wikimedia Commons)</img>
A **difference amplifier** is funky. To ensure that output is zero when inputs are equal, $\frac{R_1}{R_2}=\frac{R_3}{R_4}$.
$$v_o=\frac{R_2}{R_1}(v_2-v_1)$$
<img src="https://upload.wikimedia.org/wikipedia/commons/a/a2/Op-Amp_Differential_Amplifier.svg" width=700>(Source: Wikimedia Commons)</img>
## Capacitors
Capacitors are open circuits in DC that store energy in electric fields. Capacitance is measured in **farads** ($\pu{1 F = 1 C/V}$).
Where $A$ is the cross-section area of the wire, $\epsilon$ is the permittivity of the dielectric, and $d$ is the distance between plates:
$$C=\frac{\epsilon A}{d}$$
Capacitors charge only when power is positive ($VI>0$).
For linear capacitors:
$$i=C\frac{dv}{dt}$$
$$v(t)=\frac{1}{C}\int^t_{t_0}i(t)dt+v(t_0)$$
The energy in a capacitor can be interconverted.
$$U=\frac 1 2 CV^2$$
Capacitor rules are the opposite of resistor rules.
- In parallel: $C_{eq} = C_1 + C_2 + ...$
- In series: $\frac{1}{C_{eq}} = \frac{1}{C_1} + \frac{1}{C_2} + ...$
## Inductors
Inductors store energy in their magnetic field. Inductance is measured in **henrys** ($\pu{1 H = 1 V\cdot S/A}$). An ideal inductor has zero resistance and capacitance
Where $L$ is the inductance (opposition of charge flow):
$$V=L\frac{di}{dt}$$
Inductor rules are the same as resistor rules.
### Selenoids
Selenoids have an inductance based on their cross sectional area $A$, number of coils $N$, length $\ell$, and core permeability $\mu$:
$$L=\frac{N^2\mu A}{\ell}$$
Where $i(t_0)$ is the total current for $-\infty<t<t_0$
$$i=\frac 1 L\int^t_{t_0}v(t)dt + i(t_0)$$
Much like capacitors, inductors have energy now based on current.
$$U=\frac 1 2 Li^2$$
## First-order circuits
!!! definition
- An **RC** circuit contains a resistor and a capacitor.
- An **RL** circuit contains a resistor and an inductor.
- **First-order circuits** contain derivatives.
- A **source-free circuit** assumes that energy already exists in the capacitor/inductor and no external energy enters the system.
- The **circuit response** is the behaviour of the circuit after excitation.
- The **natural response** is the behaviour of the circuit without external excitation.
The **time constant** $\tau$ is the time requirement for the circuit to decay to $\frac 1 e$ of its initial value. For RC circuits:
$$\tau=RC$$
$$v(t)=v_0e^{-t/\tau}$$
RL circuits have very similar formulae:
$$\tau=\frac L R$$
$$i(t)=i_0e^{-t/\tau}$$
### Singularity functions
The **unit step function** is a stair that is undefined at zero.
$$
u(t)=\begin{cases}
0 & \text{if }t<0 \\
1 & \text{if }t>0
$$
The **unit impulse/delta function** is the derivative of the unit step function.
$$
\delta(t)=\frac{d}{dt}u(t)=\begin{cases}
0 & \text{if }t<0 \\
\text{undefined} & \text{if }t=0 \\
0 & \text{if }t>0
$$
The sudden spike at $t=0$ means that $\int^{0+}_{0-}\delta(t)dt=1$.
This function is related to signal strength. For the function $a\delta(t+y)$, changing $y$ shifts the phase while shifting $a$ shifts amplitude.
To obtain $f(t)$ at the impulse:
$$\int^b_a\delta(t-t_0)dt=f(t_0$$
The **unit ramp function** is the integral of the unit step function.
\begin{align*}
r(t)&=\int^1_{-\infty}u(\lambda)d\lambda=tu(t) \\
&=\begin{cases}
0 & \text{if }t\leq 0 \\
t & \text{if }t\geq 0
\end{cases}
\end{align*}
## Circuit responses
The total response to a circuit $V$ can be expressed as various combinations of:
- the natural response, $v_n=v_0e^{-t/\tau}$
- the forced response (induced) $v_f=v_s(1-e^{-t\tau})$
- the temporary response, $(v_0-v_s)e^{-1/t}$
- the permanent/steady-state response, $v_s$
$$
v(t)=\begin{cases}
v_0 & \text{if }t<0 \\
v_s+(v_0-v_s)e^{-t/\tau} &\text{if }t>0
\end{cases}
$$
In general, for current and voltage ($x$), where $x_\infty$ is the final value and $x_0$ is the initial value:
$$\boxed{x(t)=x(\infty)+[x(0)-x(\infty)]^{-t/\tau}}$$
A delayed response by $t_0$ shifts $t$ to $t-t_0$ and $x(0)$ to $x(t_0)$.
## Alternating current
Where $V_m$ is the amplitude of the voltage and $\omega$ is its angular frequency:
$$v(t)=V_m\sin(\omega t)$$
For a sinusoid's period $T$, a circuit is period if and only if, for all $n\in\mathbb Z$:
$$v(t)=v(t+nT)$$
### Phasors
The **phasor** is the complex number vector version of the sinusoid in the time domain.
$$v(t)=\text{Re}(\bold Ve^{j\omega t})$$
Please see [MATH 115: Linear Algebra#Geometry](/1a/math115/#geometry) for more information.
$$\bold V=V_m^{j\phi}$$
To transform time domains to frequency domains:
| Sinusoidal | Phasor |
| --- | --- |
| $V_m\cos(\omega t+\phi)$ | $V_m\angle\phi$ |
| $V_m\sin(\omega t+\phi)$ | $V_m\angle\phi-90^\circ$ |
The **derivative** of a phasor is itself multiplied by $j\omega$.
$$\frac{d}{dt}\bold V=j\omega\bold V$$
Adding sinusoids of the **same frequency** ($\omega$) is equivalent to adding their phasors.
If $\bold V$ and $\bold I$ are phasors:
- Inductors: $\bold V=j\omega L\bold I$ ($\bold I$ lags $\bold V$ by 90°)
- Capacitors: $\bold V=\frac{I}{j\omega C}$ ($\bold V$ lags $\bold I$ by 90°)
The **scalar** quantity of **impedance** represents the opposition to electron flow, measured in ohms.
$$Z=\frac{1}{j\omega C}=j\omega L$$
It is effectively generalised resistance. Where $X$ is a positive value representing **reactance** such that $+jX$ implies inductance while $-jX$ implies capacitance:
$$Z=\frac{\bold V}{\bold I}=R\pm jX$$
**Admittance** is the inverse of impedance with units Siemens/mhos with factors **conductance** and **susceptance**:
$$Y=G+jB$$
Arranging equations yields
$$
G=\frac{R}{R^2+X^2} \\
B=-\frac{X}{R^2+X^2}
$$
### Steady state analysis
**Kirchoff's laws** only hold for phasor forms.
1. Convert to phasor forms
2. Solve phasor forms
3. Convert back to time domain
Superposition must be summed at the end only, although individual components can first be solved.
1. Convert to phasor forms
2. Solve each individual current/voltage that make KCL/KVL
3. Convert to time domain
4. Apply KCL/KVL
When applying source transformations, different equivalent circuits for **each frequency** must be calculated individually — reducing it to one equivalent circuit is not possible.
### Power
The average power is the integral average of instantaneous power:
$$P=\frac 1 T \int^T_0 p(t)dt$$
!!! tip
The average of a sinusoid over its period is zero.
Alternatively, power can be calculated with magnitudes:
$$P=\frac 1 2\text{Re}[VI^*]=\frac 1 2 V_mI_m\cos(\theta_v-\theta_i)$$
The same rules for maximum power transfer apply with resistance, but with $Z_L$ as the **complex conjugate** of $Z_{Th}$. The maximum power has a shortcut formula:
$$P_{max}=\frac{|V_{Th}^2}{8R_{Th}}$$
The **effective value** of a sinusoid is its DC equivalent. It is the root mean square.
$$X_{rms}=\sqrt{\frac 1 T\int^T_0x^2dt}$$
The **apparent power** $S$ is the seemingly true power.
$$S=V_{rms}I_{rms}$$
The **power factor (pf)** is the required factor to take the apparent power into real power.
$$pf=\frac P S = \cos(\theta_v-\theta_i)$$
The **power factor angle** $\theta_v-\theta_i$ is the angle of local impedance between voltage and current.
$$Z=\frac{V_{rms}}{I_{rms}}\phase{\theta_v-\theta_i}=\frac{V_m}{I_m}\phase{\theta_v-\theta_i}$$
- A **leading** power factor has current lead voltage (capacitive)
- A **lagging** power factor has voltage lead current (inductive)
- A **unity** power factor has no phase shift
Complex power $\bold S$ stores more phase information where $\bold{V_{rms}}=V_{rms}\phase{\theta_v}$.
$$\bold S=\frac 1 2\bold{VI}^*=\bold{V_{rms}I^*_{rms}}$$
These have units volt-amperes (VA).
$$\bold S=V_{rms}I_{rms}\phase{\theta_v-\theta_i}=V_{rms}I_{rms}\cos(\theta_v-\theta_i)+jV_{rms}I_{rms}\sin(\theta_v-\theta_i)$$
The two components of complex power are actual power $P=I^2_{rms}R$ and reactive power $Q=I^2_{rms}X$, the latter with units VAR (volt-ampere reactive).
$$\bold S=P+jQ$$
Complex power still follows most DC laws:
$$\bold S=I^2_{rms}\bold Z=\frac{V^2_{rms}}{\bold Z^*}=\bold{V_{rms}I^*_{rms}}$$
All powers (instantaneous, real, reactive, and complex) are conserved, except for apparent power.

View File

@ -1,3 +0,0 @@
# ECE 192: Engineering Economics
History is better!

View File

@ -1,851 +0,0 @@
# MATH 119: Calculus 2
## Multivariable functions
!!! definition
- A **multivariable function** accepts more than one independent variable, e.g., $f(x, y)$.
The signature of multivariable functions is indicated in the form *[identifier]*: *[input type]**[return type]*. Where $n$ is the number of inputs:
$$f: \mathbb R^n \to \mathbb R$$
!!! example
The following function is in the form $f: \mathbb R^2\to\mathbb R$ and maps two variables into one called $z$ via function $f$.
$$(x,y)\longmapsto z=f(x,y)$$
### Sketching multivariable functions
!!! definition
- In a **scalar field**, each point in space is assigned a number. For example, topography or altitude maps are scalar fields.
- A **level curve** is a slice of a three-dimensional graph by setting to a general variable $f(x, y)=k$. It is effectively a series of contour plots set in a three-dimensional plane.
- A **contour plot** is a graph obtained by substituting a constant for $k$ in a level curve.
Please see [level set](https://en.wikipedia.org/wiki/Level_set) and [contour line](https://en.wikipedia.org/wiki/Contour_line) for example images.
In order to create a sketch for a multivariable function, this site does not have enough pictures so you should watch a YouTube video.
!!! example
For the function $z=x^2+y^2$:
For each $x, y, z$:
- Set $k$ equal to the variable and substitute it into the equation
- Sketch a two-dimensional graph with constant values of $k$ (e.g., $k=-2, -1, 0, 1, 2$) using the other two variables as axes
Combine the three **contour plots** in a three-dimensional plane to form the full sketch.
A **hyperbola** is formed when the difference between two points is constant. Where $r$ is the x-intercept:
$$x^2-y^2=r^2$$
<img src="/resources/images/hyperbola.svg" width=600 />
If $r^2$ is negative, the hyperbola is is bounded by functions of $x$, instead.
## Limits of two-variable functions
A function is continuous at $(x, y)$ if and only if all possible lines through $(x, y)$ have the same limit. Or, where $L$ is a constant:
$$\text{continuous}\iff \lim_{(x, y)\to(x_0, y_0)}f(x, y) = L$$
In practice, this means that if any two paths result in different limits, the limit is undefined. Substituting $x|y=0$ or $y=mx$ or $x=my$ are common solutions.
!!! example
For the function $\lim_{(x, y)\to (0,0)}\frac{x^2}{x^2+y^2}$:
Along $y=0$:
$$\lim_{(x,0)\to(0, 0)} ... = 1$$
Along $x=0$:
$$\lim_{(0, y)\to(0, 0)} ... = 0$$
Therefore the limit does not exist.
## Partial derivatives
Partial derivatives have multiple different symbols that all mean the same thing:
$$\frac{\partial f}{\partial x}=\partial_x f=f_x$$
For two-input-variable equations, setting one of the input variables to a constant will return the derivative of the slice at that constant.
By definition, the **partial** derivative of $f$ with respect to $x$ (in the x-direction) at point $(a, B)$ is:
$$\frac{\partial f}{\partial x}(a, B)=\lim_{h\to 0}\frac{f(a+h, B)-f(a, B)}{h}$$
Effectively:
- if finding $f_x$, $y$ should be treated as constant.
- if finding $f_y$, $x$ should be treated as constant.
!!! example
With the function $f(x,y)=x^2\sqrt{y}+\cos\pi y$:
\begin{align*}
f_x(1,1)&=\lim_{h\to 0}\frac{f(1+h,1)-f(1,1)} h \\
\tag*{$f(1,1)=1+\cos\pi=0$}&=\lim_{h\to 0}\frac{(1+h)^2-1} h \\
&=\lim_{h\to 0}\frac{h^2+2h} h \\
&= 2 \\
\end{align*}
### Higher order derivatives
!!! definition
- **wrt.** is short for "with respect to".
$$\frac{\partial^2f}{\partial x^2}=\partial_{xx}f=f_{xx}$$
Derivatives of different variables can be combined:
$$f_{xy}=\frac{\partial}{\partial y}\frac{\partial f}{\partial x}=\frac{\partial^2 f}{\partial xy}$$
The order of the variables matter: $f_{xy}$ is the derivative of f wrt. x *and then* wrt. y.
**Clairaut's theorem** states that if $f_x, f_y$, and $f_{xy}$ all exist near $(a, b)$ and $f_{yx}$ is continuous **at** $(a,b)$, $f_{yx}(a,b)=f_{x,y}(a,b)$ and exists.
!!! warning
In multivariable calculus, **differentiability does not imply continuity**.
### Linear approximations
A **tangent plane** represents all possible partial derivatives at a point of a function.
For two-dimensional functions, the differential could be used to extrapolate points ahead or behind a point on a curve.
$$
\Delta f=f'(a)\Delta d \\
\boxed{y=f(a)+f'(a)(x-a)}
$$
The equations of the two unit direction vectors in $x$ and $y$ can be used to find the normal of the tangent plane:
$$
\vec n=\vec d_1\times\vec d_2 \\
\begin{bmatrix}-f_x(a,b) \\ -f_y(a,b) \\ 1\end{bmatrix} = \begin{bmatrix}1\\0\\f_x(a,b)\end{bmatrix}
\begin{bmatrix}0\\1\\f_y(a,b)\end{bmatrix}
$$
Therefore, the general expression of a plane is equivalent to:
$$
z=C+A(x-a)+B(x-b) \\
\boxed{z=f(a,b)+f_x(a,b)(x-a)+f_y(a,b)(y-b)}
$$
??? tip "Proof"
The general formula for a plane is $c_1(x-a)+c_2(y-b)+c_3(z-c)=0$.
If $y$ is constant such that $y=b$:
$$z=C+A(x-a)$$
which must represent in the x-direction as an equation in the form $y=b+mx$. It follows that $A=f_x(a,b)$. A similar concept exists for $f_y(a,b)$.
If both $x=a$ and $y=b$ are constant:
$$z=C$$
where $C$ must be the $z$-point.
Usually, functions can be approximated via the **tangent at $x=a$.**
$$f(x)\simeq L(x)$$
!!! warning
Approximations are less accurate the stronger the curve and the farther the point is away from $f(a,b)$. A greater $|f''(a)|$ indicates a stronger curve.
!!! example
Given the function $f(x,y)=\ln(\sqrt[3]{x}+\sqrt[4]{y}-1)$, $f(1.03, 0.98)$ can be linearly approximated.
$$
L(x=1.03, y=0.98)=f(1,1)=f_x(1,1)(x-1)+f_y(1,1)(y-1) \\
f(1.03,0.98)\simeq L(1.03,0.98)=0.005
$$
### Differentials
Linear approximations can be used with the help of differentials. Please see [MATH 117#Differentials](/1a/math117/#differentials) for more information.
$\Delta f$ can be assumed to be equivalent to $df$.
$$\Delta f=f_x(a,b)\Delta x+f_y(a,b)\Delta y$$
Alternatively, it can be expanded in Leibniz notation in the form of a **total differential**:
$$df=\frac{\partial f}{\partial x}dx+\frac{\partial f}{\partial y}dy$$
??? tip "Proof"
The general formula for a plane in three dimensions can be expressed as a tangent plane if the differential is small enough:
$$f(x,y)=f(a,b)+f_x(a,b)(x-a)+f_y(a,b)(x-b)$$
As $\Delta f=f(x,y)-f(a,b)$, $\Delta x=x-a$, and $\Delta y=y-b$, it can be assumed that $\Delta x=dx,\Delta y=dy, \Delta f\simeq df$.
$$\boxed{\Delta f\simeq df=f_x(a,b)dx+f_y(a,b)dy}$$
### Related rates
Please see [SL Math - Analysis and Approaches 1](/g11/mhf4u7/#related-rates) for more information.
!!! example
For the gas law $pV=nRT$, if $T$ increases by 1% and $V$ increases by 3%:
\begin{align*}
pV&=nRT \\
\ln p&=\ln nR + \ln T - \ln V \\
\tag{multiply both sides by $d$}\frac{d}{dp}\ln p(dp)&=0 + \frac{d}{dT}\ln T(dt)-\frac{d}{dV}\ln V(dV) \\
\frac{dp}{p} &=\frac{dT}{T}-\frac{dV}{V} \\
&=0.01-0.03 \\
&=-2\%
\end{align*}
### Parametric curves
Because of the existence of the parameter $t$, these expressions have some advantages over scalar equations:
- the direction of $x$ and $y$ can be determined as $t$ increases, and
- the rate of change of $x$ and $y$ relative to $t$ as well as each other is clearer
$$
\begin{align*}
f(x,y,z)&=\begin{bmatrix}x(t) \\ y(t) \\ z(t)\end{bmatrix} \\
&=(x(t), y(t), z(t))
\end{align*}
$$
The **derivative** of a parametric function is equal to the vector sum of the derivative of its components:
$$\frac{df}{dt}=\sqrt{\left(\frac{dx}{dt}\right)^2+\left(\frac{dy}{dt}\right)^2+\left(\frac{dz}{dt}\right)^2}$$
Sometimes, the **chain rule for multivariable functions** creates a new branch in a tree for each independent variable.
For two-variable functions, if $z=f(x,y)$:
$$\frac{dz}{dt}=\frac{\partial z}{\partial x}\frac{dx}{dt}+\frac{\partial z}{\partial y}\frac{dy}{dt}$$
Sample tree diagram:
<img src="/resources/images/two-var-tree.jpg" width=300>(Source: LibreTexts)</img>
!!! example
This can be extended for multiple functions — for the function $z=f(x,y)$, where $x=g(u,v)$ and $y=h(u,v)$:
<img src="/resources/images/many-var-tree.jpg" width=300>(Source: LibreTexts)</img>
Determining the partial derivatives with respect to $u$ or $v$ can be done by only following the branches that end with those terms.
$$
\frac{\partial z}{\partial u} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial u} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial u} \\
$$
!!! warning
If the function only depends on one variable, $\frac{d}{dx}$ is used. Multivariable functions must use $\frac{\partial}{\partial x}$ to treat the other variables as constant.
### Gradient vectors
The **gradient vector** is the vector of the partial derivatives of a function with respect to its independent variables. For $f(x,y)$:
$$\nabla f=\left(\frac{\partial f}{\partial x},\frac{\partial f}{\partial y}\right)$$
This allows for the the following replacements to appear more like single-variable calculus. Where $\vec r=(x,y)$ is a desired point, $\vec a=(a,b)$ is the initial point, and all vector multiplications are dot products:
Linear approximations are simplified to:
$$f(\vec r)=f(\vec a)+\nabla f(\vec a)\bullet(\vec r-\vec a)$$
The chain rule is also simplified to:
$$\frac{dz}{dt}=\nabla f(\vec r(t))\bullet\vec r'(t)$$
A **directional derivative** is any of the infinite derivatives at a certain point with the length of a unit vector. Specifically, in the unit vector direction $\vec u$ at point $\vec a=(a,b)$:
$$D_{\vec u}f(a_b)=\lim_{h\to 0}\frac{f(\vec a+h\vec u)\bullet f(\vec a)}{h}$$
This reduces down by taking only $h$ as variable to:
$$D_{\vec u}f(a,b)=\nabla f(a,b)\bullet\vec u$$
Cartesian and polar coordinates can be easily converted between:
- $x=r\sin\theta\cos\phi$
- $y=r\sin\theta\sin\phi$
- $z=r\cos\theta$
## Optimisation
**Local maxima / minima** exist at points where all points in a disk-like area around it do not pass that point. Practically, they must have $\nabla f=0$.
**Critical points** are any point at which $\nabla f=0|undef$. A critical point that is not a local extrema is a **saddle point**.
Local maxima tend to be **concave down** while local minima are **concave up**. This can be determined via the second derivative test. For the critical point $P_0$ of $f(x,y)$:
1. Calculate $D(x,y)= f_{xx}f_{yy}-(f_{xy})^2$
2. If it greater than zero, the point is an extremum
a. If $f_{xx}(P_0)<0$, the point is a maximum otherwise it is a minimum
3. If it is less than zero, it is a saddle point — otherwise the test is inconclusive and you must use your eyeballs
### Optimisation with constraints
If there is a limitation in optimising for $f(x,y)$ in the form $g(x,y)=K$, new critical points can be found by setting them equal to each other, where $\lambda$ is the **Lagrange multiplier** that determines the rate of increase of $f$ with respect to $g$:
$$\nabla f = \lambda\nabla g, g(x,y)=K$$
The largest/smallest values of $f(x,y)$ from the critical points return the maxima/minima. If possible, $\nabla g=\vec 0, g(x,y)=K$ should also be tested **afterward**.
!!! example
If $A(x,y)=xy$, $g(x,y)=K: x+2y=400$, and $A(x,y)$ should be maximised:
\begin{align*}
\nabla f &= \left<y, x\right> \\
\nabla g &= \left<1, 2\right> \\
\left<y, x\right> &= \lambda \left<1, 2\right> \\
&\begin{cases}
y &= \lambda \\
x &= 2\lambda \\
x + 2y &= 400 \\
\end{cases}
\\
\\
\therefore y&=100,x=200,A=20\ 000
\end{align*}
??? example
If $f(x,y)=y^2-x^2$ and the constraint $\frac{x^2}{4} + y^2=1$ must be satisfied:
\begin{align*}
\nabla f &=\left<-2x, 2y\right> \\
\nabla g &=\left<\frac{1}{2} x,2y\right> \\
\tag{$\left<0,0\right>$ does not satisfy constraints} \left<-2x,2y\right>&=\lambda\left<-\frac 1 2 x,2y\right> \\
&\begin{cases}
-2x &= \frac 1 2\lambda x \\
2y &= \lambda2y \\
\frac{x^2}{4} + y^2&= 1
\end{cases} \\
\\
2y(1-\lambda)&=0\implies y=0,\lambda=1 \\
&\begin{cases}
y=0&\implies x=\pm 2\implies\left<\pm2, 0\right> \\
\lambda=1&\implies \left<0,\pm 1\right>
\end{cases}
\\
\tag{by substitution} \max&=(2,0), (-2, 0) \\
\min&=(0, -1), (0, 1)
\end{align*}
??? example
If $f(x, y)=x^2+xy+y^2$ and the constraint $x^2+y^2=4$ must be satisfied:
\begin{align*}
\tag{domain: bounded at $-2\leq x\leq 2$}y=\pm\sqrt{4-x^2} \\
f(x,\pm\sqrt{4-x^2}) &= x^2+(\pm\sqrt{4-x^2})x + 4-x^2 \\
\frac{df}{dx} &=\pm(\sqrt{4-x^2}-\frac{1}{2}\frac{1}{\sqrt{4-x^2}}2x(x)) \\
\tag{$f'(x)=0$} 0 &=4-x^2-x^2 \\
x &=\pm\sqrt{2} \\
\\
2+y^2 &= 4 \\
y &=\pm\sqrt{2} \\
\therefore f(x,y) &= 2, 6
\end{align*}
Alternatively, trigonometric substitution may be used to solve the system parametrically.
\begin{align*}
x^2+y^2&=4\implies &x=2\cos t \\
& &y=2\sin t \\
\therefore f(x,y) &= 4+2\sin(2t),0\leq t\leq 2\pi \\
\tag{include endpoints $0,2\pi$}t &= \frac\pi 4,\frac{3\pi}{4},\frac{5\pi}{4} \\
\end{align*}
!!! warning
Terms cannot be directly cancelled out in case they are zero.
This applies equally to higher dimensions and constraints by adding a new term for each constraint. Given $f(x,y,z)$ with constraints $g(x,y,z)=K$ and $h(x,y,z)=M$:
$$\nabla f=\lambda_1\nabla g + \lambda_2\nabla h$$
### Absolute extrema
- If end points exist, those should be added
- If no endpoints exist and the limits go to $\pm\infty$, there are no absolute extrema
## Double integration
In a nutshell, double integration is done by taking infinitely small lines then finding the area under those lines to form a volume.
For a surface formed by vectors $[a,b]$ and $[c,d]$:
$$[a,b]\times[c,d]=R=\{(x,y)|a\leq x\leq b,c\leq y\leq d\}$$
If the function is continuous and bounds do not depend on variables, the order of integration doesn't matter.
$$\boxed{\int^d_c\int^b_af(x,y)dxdy}$$
!!! example
For $f(x,y)=x^2y$ and $R=[0,3]\times[1,2]$:
\begin{align*}
V&=\int^2_1\int^3_0x^2ydxdy \\
&=\int^2_1\left[\frac 1 3 3^3y\right]dy \\
&=\frac{9}{2}y^2\biggr|^2_1 \\
&=\frac 9 2 (4)-\frac 9 2 \\
&=\frac{27}{2}
\end{align*}
If the function is the product of two functions of separate variables, i.e., if $f(x,y)=g(x)\cdot h(y)$:
$$\int^b_a\int^d_cg(x)h(y)dxdy=\left(\int^b_ah(y)dy\right)\left(\int^d_cg(x)dx\right)$$
### Volume betweeen two functions
The result of the bound variable should be integrated first. For functions of $y$:
$$\int^b_a\left(\int^{g(x)}_{h(x)}f(x,y)dy\right)dx$$
Functions can also be replaced to be bounded by the other if necessary.
!!! example
For $f(x,y)$ bounded by $y=x$ and $y=\sqrt x$:
$$\int^1_0\int^{\sqrt x}_xf(x,y)dydx = \int^1_0\left(\int^y_{y^2}f(x,y)dx\right)dy$$
??? example
For $f(x,y)=xy$ bounded by $x=2$, $y=0$, and $y=2x$:
\begin{align*}
\int^2_0\int^{2x}_0xy\ dydx&=\int^2_0x\left(\frac 1 2(2x)^2\right)dx \\
&=\int^2_02x^3dx \\
&=\frac 1 4 x^4(2)\biggr|^2_0 \\
&= 8
\end{align*}
### Double polar integrals
The differential elements can be directly replaced:
$$dA=dxdy=\rho d\rho d\phi$$
In general, the radius should be the inner integral, and functions converted from Cartesian to polar forms.
$$\int^{\phi_2}_{\phi_1}\int^{\rho_2}_{\rho_1}f(\rho\cos\phi,\rho\sin\phi)\rho d\rho d\phi$$
### Change of variables
The **Jacobian** is the proportion of change in the differentials between different coordinate systems.
$$
\frac{\partial(x,y)}{\partial(u, v)}=\det\begin{bmatrix}
\partial x / \partial u & \partial x / \partial v \\
\partial y / \partial u & \partial y / \partial v
\end{bmatrix}
$$
The Jacobian can be treated as a fraction — it may be easier to determine the reciprocal of the Jacobian and then reciprocal it again.
When converting between two systems, the absolute value of the Jacobian should be incorporated.
$$dA=\left|\frac{\partial(x,y)}{\partial(u,v)}\right|du\ dv$$
!!! example
The Jacobian of the polar coordinate system relative to the Cartesian coordinate system is $\rho$. Therefore, $dA=\rho\ d\rho\ d\phi$.
If $x=x(u,v)$, $y=y(u,v)$, and $\partial(x,y)/\partial(u,v)\neq 0$ in the domain of $u$ and $v$ $D_{uv}$:
$$\iint_{D_{xy}}f(x,y)dA = \iint_{D_{uv}}f(x(u,v),y(u,v))\left|\frac{\partial(x,y)}{\partial(u,v)}\right|du\ dv$$
1. Pick a good transformation that simplifies the domain and/or the function.
2. Compute the Jacobian
3. Determine bounds (domain)
4. Integrate with the formula
If the Jacobian contains $x$ and/or $y$ terms:
- they can be substituted into the integral directly, praying that the terms all cancel out
- or $x$ and $y$ can be written in terms of $u$ and $v$ and then all substituted
!!! example
For the volume within $x^2y^2\sqrt{1-x^3-y^3}$ bounded by $x=0,y=0,x^3+y^3=1$:
By graphical inspection, the bounds can be determined to be $x=0,y=0, y^3=x^3-1,x=1$.
Let $u=x^3,du=3x^2dx$. Let $v=y^3,dv=3y^2dy$. The bounds change to $0\leq u\leq 1,0\leq v\leq 1-u$.
\begin{align*}
\int^1_0\int^{1-u}_0\frac 1 9\sqrt{1-u-v}\ dudv &= \int^1_0\frac{2}{27}(1-v-u)^{3/2}\biggr|^{1-u}_0du \\
&= \int^1_0\frac{2}{27}(1-u)^{3/2}du \\
&= \frac{4}{135}(1-u)^{5/2}\biggr|^1_0 \\
&= \frac{4}{135}
\end{align*}
### Applications of multiple integrals
The area enclosed within bounds $R$ is the volume with a height of 1.
$$A_R=\iint_R 1\ dA$$
!!! example
For the area between $y=(x-1)^2$ and $y=5-(x-2)^2$:
POI: $x^2-3x=0,\therefore x=0, 3$
\begin{align*}
\int^3_0\int^{5-(x-2)^2}_{(x-1)^2}dydx &=\int^3_0(5-(x-2)^2-(x-1)^2)dx \\
&=\int^3_0(-2x^2+6x)dx \\
&=-\frac 2 3x^3+3x^2\biggr|^3_0 \\
&=9
\end{align*}
!!! example
For the area of $\left(\frac x a\right)^2+\left(\frac y b\right)^2=1$ in the region $a,b>0$:
**For ellipses of this form, a direct substitution to $a\rho\cos\phi$ and $b\rho\cos\phi$ is fastest.**
Let $u=\frac x a$ and $v=\frac y b$.
$$
\frac{\partial(x,y)}{\partial(u,v)}=\det\begin{bmatrix}
a & 0 \\
0 & b
\end{bmatrix}=ab
$$
Thus $A=\iint_Rab\ du\ dv$.
Let $u=\rho\cos\phi,v=\rho\sin\phi$. Radius is 1 by inspection.
\begin{align*}
A&=\int^{2\pi}_0\int^1_0ab\rho\ d\rho\ d\phi \\
&=\int^{2\pi}\frac 1 2 ab\ d\phi \\
&=\frac 1 2 ab\phi\biggr|^{2\pi}_0 \\
&=\pi ab
\end{align*}
The average value of the function $f(x,y)$ over a region $R$, where $A_R$ is the area of the region:
$$\overline{f}_R=\frac{1}{A_R}\iint_Rf(x,y) dA$$
!!! example
The average value of $x^2+y^2$ over $x=0,x=1, y=x$:
\begin{align*}
\text{avg}&=\frac 1 A\int^1_0\int^x_0(x^2+y^2)dydx \\
&=2\int^1_0(x^2y+\frac 1 3y^3)\biggr|^x_0dx \\
&=2\int^1_0\frac 4 3 x^3dx \\
&=\frac 2 3 x^4 \biggr|^1_0 \\
&=\frac 2 3
\end{align*}
The total "amount" of within a region, if $f(x,y)$ describes the density at point $(x,y)$:
$$\iint_R f(x,y)dA$$
!!! example
The total of $x^2+y^2$ with density $\sigma=\sqrt{1-x^2-y^2}$:
Let $x^2=\rho\cos\phi,y^2=\rho\sin\phi$. Thus $\sigma=\sqrt{1-\rho^2}$.
\begin{align*}
M&=\int^{2\pi}_0\int^1_0\sqrt{1-\rho^2}\rho\ d\rho\ d\phi \\
&=\int^{2\pi}_0d\phi\int^1_0\sqrt{1-\rho^2}\ d\rho\ d\phi \\
\end{align*}
Let $u=1-\rho^2$. Thus $du=-2\rho\ d\rho$.
\begin{align*}
m&=2\pi\int^1_0-\frac 1 2\sqrt u du \\
&=\frac 2 3u^{3/2}du\biggr|^1_0 \\
&=\frac 2 3\pi
\end{align*}
## Triple integration
Much like double integrals:
The **volume** within bounds $E$ is the integral of 1:
$$V=\iiint_E1dV$$
The **average value** within a volume is:
$$\overline f_E=\frac 1 V\iiint_Ef(x,y,z)dV$$
!!! example
For the volume within $x+y+z=1$ and $2x+2y+z=2,x,y,z\geq 0$:
The points intersect the axes and each other to create the bounds $0\leq x\leq 1,0\leq y\leq 1-x,1-x-y\leq z\leq 2-2x-2y$.
$$\int^1_0\int^{1-x}_0\int^{2-2x-2y}_{1-x-y}1dz\ dy\ dx =\frac 1 6$$
The average value is:
$$6\iiint_Ez\ dV=\frac 3 4$$
The **total quantity** if $f$ represents density is:
$$T=\iiint_Ef(x,y,z)dV$$
### Cylindrical coordinates
Cylindrical coordinates are effectively polar coordinates with a height.
$$
x=\rho\cos\phi \\
y=\rho\sin\phi \\
z=z
$$
$$
\rho=\sqrt{x^2+y^2} \\
\tan\phi=\frac y x
$$
The Jacobian is still $\rho$.
!!! example
For the volume under $z=9-x^2-y^2$, outside $x^2+y^2=1$, and above the $xy$ plane:
- $0\leq z\leq 9-x^2-y^2\implies 0\leq z\leq 9-\rho^2$
- $1\leq \rho\leq 3$
- $0\leq \phi\leq 2\pi$
$$
\int^3_1\int^{2\pi}_0\int^{9-\rho^2}_0\rho\ dz\ d\rho\ d\phi =32\pi
$$
### Spherical coordinates
Where $r$ is the direct distance from the point to the origin, $\phi$ is the angle to the x-axis in the xy-plane ($[0,2\pi]$), and $\theta$ is the angle to the z-axis, top to bottom ($[0,\pi]$):
$$
z=r\cos\theta \\
x=r\sin\theta\cos\phi \\
y=r\sin\theta\sin\phi
$$
The Jacobian is $r^2\sin\theta$.
!!! example
The mass inside the sphere $x^2+y^2+z^2=9$ with density $z=\sqrt{\frac{x^2+y^2}{3}}$:
It is clear that $\tan\theta=\sqrt 3\implies\theta=\frac\pi 3,r=3$. Thus:
$$\int^3_0\int^{\pi/3}_0,\int^{2\pi}_0 \frac{\rho}{\sqrt{3}}\rho\ d\phi\ d\theta\ d\rho=\frac{243\pi}{5}$$
## Approximation and interpolation
Each of these finds roots, so a rooted equation is needed.
!!! example
To find an $x$ where $x=\sqrt 5$, the root of $x^2-5=0$ should be found.
### Bisection
1. Select two points that are guaranteed to enclose the point
2. Select an arbitrary $x$ and check if it is greater than or less than zero
3. Slice the remaining section in half in the correct direction
### Newton's method
The below formula can be repeated after plugging in an arbitrary value.
$$x_1=x_0-\frac{f(x_0)}{f'(x_0}$$
!!! warning
If Newton's method converges to the wrong root, bisection is necessary to brute force the result.
### Polynomial interpolation
Where $\Delta^k y_0$ are the $k$th differences between the $y$ points:
$$f(x)=y_0+x\Delta y_0+x(x-1)\frac{\Delta^2y_0}{2!}+x(x-1)(x-2)\frac{\Delta^3 y_0}{3!} ...$$
### Taylor polynomials
The $n$th order Taylor polynomial centred at $x_0$ is:
$$\boxed{P_{n,x_0}(x)=\sum^n_{k=0}\frac{f^{(k)}(x_0)(x-x_0)^k}{k!}}$$
**Maclaurin's theorem** states that if some function $P^{(k)}(x_0)=f^{(k)}(x_0)$ for all $k=0,...n$:
$$P(x)=P_{n,x_0}(x)$$
!!! example
If $P(x)=1+x^3+\frac{x^6}{2}$ and $f(x)=e^{x^5}}$, ... TODO
The desired function $P(x)$ being the $n$th degree Maclaurin polynomial implies that $P(kx^m)$ is the $(mn)$th degree polynomial for $f(kx^m)$.
Therefore, if you have the Maclaurin polynomial $P(x)$ where $P$ is the $n$th order Taylor polynomial:
- $P'(x)=P_{n-1,x_0}(x)$ for $f'(x)$
- $\int P(x)dx=P_{n+1,x_0}(x)$ for $\int f(x)dx$
The integration constant $C$ can be found by substituting $x_0$ as $x$ and solving.
For $m\in\mathbb Z\geq 0$, where $P(x)$ is the Maclaurin polynomial for $f(x)$ of order $n$, $x^mP(x)$ is the $(m+n)$th order polynomial for $x^mf(x)$.
### Taylor inequalities
The **triangle inequality** for integrals applies itself many times over the infinite sum.
$$\left|\int^b_af(x)dx\right|\leq\int^b_a|f(x)|dx$$
The **Taylor remainder** is the error between a Taylor polynomial and its actual value. Where $k$ is an arbitrary value chosen as the **upper bound** of the difference of the first derivative between $x_0$ and $x$: $k\geq |f^{(n+1)}(z)|$
$$|R_n(x)|\leq\frac{k|x-x_0|^{n+1}}{(n+1)!}$$
An approximation correct to $n$ decimal places requires that $|R_n(x)|<10^{-n}$.
!!! warning
$k$ should be as small as possible. When rounding, round down for the lower bound, and round up for the upper bound.
### Integral approximation
The upper and lower bounds of a Taylor polynomial are clearly $P(x)\pm R(x)$. Integrating them separately reveals creates bounds for the integral.
$$\int P(x)dx-\int R(x)dx\leq\int P(x)\leq\int P(x)dx +\int R(x)dx$$
## Infinite series
The $n$th partial sum of a sequence is used to determine divergence.
$$S_n=\sum^n_{k=0}a_k=a_0 + a_1 ... a_n$$
A sum converges to $S$ if the sum eventually ends up there. Otherwise, if the limit is infinity or does not exist, it diverges.
$$\lim_{x\to\infty}S_n=S\implies\sum^\infty_{n=0}a_n=S$$
### Divergence test
By the divergence test, if the limit of each term never reaches zero, the sum diverges.
$$\lim_{x\to\infty}a_n\neq 0\implies\sum^\infty_{n=0}a_n\text{ diverges}$$
### Geometric series
The $n$th partial sum of a geometric series $ar^n$ is equal to:
$$S_n=\frac{a(1-r)^{n+1}}{1-r}$$
To simply test for convergence:
- If $|r|<1$, $S_n\to\frac{a}{1-r}$.
- Otherwise, it diverges by the test for divergence.
### Integral test
If $f(x)$ is **continuous**, **decreasing**, and **positive** on some $[a,\infty)$:
$$\int^\infty_af(x)dx\text{ converges}\iff\sum^\infty_{k=a}f(k)\text{ converges$$
### p-series test
For all $p\in\mathbb R$, a series of the form
$$\sum^\infty_{n=1}\frac{1}{n^p}$$
converges if and only if $p>1$.
### Comparison test
For two series $\sum a_n$ and $\sum b_n$ where **all terms are positive**, if $a_n\leq b_n$ for all $n$, either both converge or both diverge.
The **limit comparison test** has the same requirements, but if $L=\lim_{n\to\infty}\frac{a_n}{b_n}$ such that $0<L<\infty$, either both converge or both diverge.
### Ratio tests
The **ratio test** is applicable if the $L$ exists or is infinity:
$$L+\lim_{n\to\infty}\left|\frac{a_{n+1}}{a_n}\right|$$
- $L<1$ implies the function converges absolutely
- $L>1$ implies the function diverges
- $L=1$ is inconclusive
It is useful if a constant is raised to the power of $n$ or if a factorial is present.
The **root test** has the same analysis but with a different limit:
$$L=\lim_{n\to\infty}\sqrt[n]{|a_n|}$$
It is useful for functions of the form $f(x)^{g(x)}$.
### Alternating series
If the absolute value of all terms $b_k$ continuously decreases and $\lim_{k\to b_k}=0$, the alternating function $\sum^\infty_{k=0}(-1)^kb_k$ converges.
The **alternating series estimation theorem** places an upper bound on the error of a partial sum. If the series passes the alternate series test, $S_n$ is the $n$th partial sum, $S$ is the sum of the series, and $b_k$ is the $k$th term:
$$|S-S_n|\leq b_{n+1}$$
### Conditional convergence
$\sum a_n$ converges **absolutely** only if $\sum |a_n|$ converges.
An absolutely converging series also has its regular form converge.
A series converges **conditionally** if it converges but not absolutely. This indicates that it is possible for all $b\in\mathbb R$ to rearrange $\sum a_n$ to cause it to converge to $b$.
### Power series
A power series **centred at $x_0$** is an infinitely long polynomial.
$$\sum^\infty_{n=0}c_n(x-x_0)^n$$
If there are multiple identified domains of convergence, the endpoints must be tested separately to get the **interval of convergence**. The **radius of convergence** is the amplitude of the interval, regardless of inclusion/exclusion.
$$r=\frac{\text{max}-\text{min}}{2}$$
For a power series of radius $R$, regardless if it is differentiated, integrated, multiplied (by non-zero), the radius remains $R$.
!!! warning
The interval may change.
Adding functions with different radii results in a radius roughly near the smaller interval of convergence.
The **binomial series** is the infinite expansion of $(1+x)^m$ with radius 1.
$$(1+x)^m=\sum^\infty_{n=0}\frac{m(m-1)(m-2)...(m-n+1)}{n!}x^n$$
## Big O notation
A function $f$ is of order $g$ as $x\to x_0$ if $|f(x)|\leq c|g(x)|$ for all $x$ near $x_0$. This is written as big O:
$$f(x)=O(g(x))\text{ as }x\to x_0$$
The inner function only dictates how it grows, discarding any constant terms.
!!! example
As $x\to 0$, $x^3=O(x^2)$ as well as $O(x)$ and $O(1)$. Thus $kx^3=O(x^2)$ for all $k\in\mathbb R$.
However, $x^3=O(x^4)$ only as $x\to\infty$ by the definition.
!!! example
As $|\sin x|\leq |x|$, $\sin x=O(x)$ as $x\to 0$.
If $f=O(x^m)$ and $g=O(x^n)$ as $x\to 0$:
- $fg=O(x^{m+n})$
- $f+g=O(x^q)$, where `q=min(m,n)`
- $kO(x^n)=O(x^n)$
- $O(x^n)^m=O(x^{nm})$
- $O(x^m)\div x^n=O(x^{m-n})$
With Taylor series, big O is the remainder.
$$R_n(x)=O((x-x_0)^{n+1})$$
The limit of big O is the behaviour of $g(x)$.
!!! example
\begin{align*}
\lim_{x\to 0}\frac{x^2e^x+2\cos x-2}{x^3}&=\lim_{x\to 0}\frac{x^3+O(x^4)}{x^3} \\
&= 1+O(x) \\
&= 1
\end{align*}

View File

@ -1,3 +0,0 @@
# ECE 109: Materials Chemistry
😜

View File

@ -1,294 +0,0 @@
# ECE 204: Numerical Methods
## Linear regression
Given a regression $y=mx+b$ and a data set $(x_{i..n}, y_{i..n})$, the **residual** is the difference between the actual and regressed data:
$$E_i=y_i-b-mx_i$$
### Method of least squares
This method minimises the sum of the square of residuals.
$$\boxed{S_r=\sum^n_{i=1}E_i^2}$$
$m$ and $b$ can be found by taking the partial derivative and solving for them:
$$\frac{\partial S_r}{\partial m}=0, \frac{\partial S_r}{\partial b}=0$$
This returns, where $\overline y$ is the mean of the actual $y$-values:
$$
\boxed{m=\frac{n\sum^n_{i=1}x_iy_i-\sum^n_{i=1}x_i\sum^n_{i=1}y_i}{n\sum^n_{i=1}x_i^2-\left(\sum^n_{i=1}x_i\right)^2}} \\
b=\overline y-m\overline x
$$
The total sum of square around the mean is based off of the actual data:
$$\boxed{S_t=\sum(y_i-\overline y)^2}$$
Error is measured with the **coefficient of determination** $r^2$ — the closer the value is to 1, the lower the error.
$$
r^2=\frac{S_t-S_r}{S_t}
$$
If the intercept is the **origin**, $m$ reduces down to a simpler form:
$$m=\frac{\sum^n_{i=1}x_iy_i}{\sum^n_{i=1}x_i^2}$$
## Non-linear regression
### Exponential regression
Solving for the same partial derivatives returns the same values, although bisection may be required for the exponent coefficient ($e^{bx}$) Instead, linearising may make things easier (by taking the natural logarithm of both sides. Afterward, solving as if it were in the form $y=mx+b$ returns correct
!!! example
$y=ax^b\implies\ln y = \ln a + b\ln x$
### Polynomial regression
The residiual is the offset at the end of a polynomial.
$$y=a+bx+cx^2+E$$
Taking the relevant partial derivatives returns a system of equations which can be solved in a matrix.
## Interpolation
Interpolation ensures that every point is crossed.
### Direct method
To interpolate $n+1$ data points, you need a polynomial of a degree **up to $n$**, and points that enclose the desired value. Substituting the $x$ and $y$ values forms a system of equations for a polynomial of a degree equal to the number of points chosen - 1.
### Newton's divided difference method
This method guesses the slope to interpolate. Where $x_0$ is an existing point:
$$\boxed{f(x)=b_0+b_1(x-x_0)}$$
The constant is an existing y-value and the slope is an average.
$$
\begin{align*}
b_0&=f(x_0) \\
b_1&=\frac{f(x_1)-f(x_0)}{x_1-x_0}
\end{align*}
$$
This extends to a quadratic, where the second slope is the average of the first two slopes:
$$\boxed{f(x)=b_0+b_1(x-x_0)+b_2(x-x_0)(x-x_1)}$$
$$
b_2=\frac{\frac{f(x_2)-f(x_1)}{x_2-x_1}-\frac{f(x_1)-f(x_0)}{x_1-x_0}}{x_2-x_0}
$$
## Derivatives
Derivatives are estimated based on first principles:
$$f'(x)=\frac{f(x+h)-f(x)}{h}$$
### Derivatives of continuous functions
At a desired $x$ for $f'(x)$:
1. Choose an arbitrary $h$
2. Calculate derivative via first principles
3. Shrink $h$ and recalculate derivative
4. If the answer is drastically different, repeat step 3
### Derivatives of discrete functions
Guesses are made based on the average slope between two points.
$$f'(x_i)=\frac{f(x_{i+1})-f(x_i)}{x_{i+1}-x_i}$$
### Divided differences
- Using the next term, or a $\Delta x > 0$ indicates a **forward divided difference (FDD)**.
- Using the previous term, or a $\Delta x < 0$ indicates a **backward divided difference (BDD)**.
The **central divided difference** averages both if $h$ or $\Delta x$ of the forward and backward DDs are equal.
$$f'(x)=CDD=\frac{f(x+h)-f(x-h)}{2h}$$
### Higher order derivatives
Taking the Taylor expansion of the function or discrete set and then expanding it as necessary can return any order of derivative. This also applies for $x-h$ if positive and negative are alternated.
$$f(x+h)=f(x)+f'(x)h+\frac{f''(x)}{2!}h^2+\frac{f'''(x)}{3!}h^3$$
!!! example
To find second order derivatives:
\begin{align*}
f''(x)&=\frac{2f(x+h)-2f(x)-2f'(x)h}{h^2} \\
&=\frac{2f(x+h)-2f(x)-(f(x+h)-f(x-h))}{h^2} \\
&=\frac{f(x+h)-2f(x)+f(x-h)}{h^2}
\end{align*}
!!! example
$f''(3)$ if $f(x)=2e^{1.5x}$ and $h=0.1$:
\begin{align*}
f''(3)&=\frac{f(3.1)-2\times2f(3)+f(2.9)}{0.1^2} \\
&=405.08
\end{align*}
For discrete data:
- If the desired point does not exist, differentiating the surrounding points to create a polynomial interpolation of the derivative may be close enough.
!!! example
| t | 0 | 10 | 15 | 20 | 22.5 | 30 |
| --- | --- | --- | --- | --- | --- | --- |
| v(t) | 0 | 227.04 | 362.78 | 517.35 | 602.47 | 901.67 |
$v'(16)$ with FDD:
Using points $t=15,t=20$:
\begin{align*}
v'(x)&=\frac{f(x+h)-f(x)}{h} \\
&=\frac{f(15+5)-f(15)}{5} \\
&=\frac{517.35-362.78}{5} \\
&=30.914
\end{align*}
$v'(16)$ with Newton's first-order interpolation:
\begin{align*}
v(t)&=v(15)+\frac{v(20)-v(15)}{20-15}(t-15) \\
&=362.78+30.914(t-15) \\
&=-100.93+30.914t \\
v'(t)&=\frac{v(t+h)-v(t)}{2h} \\
&=\frac{v(16.1)-v(15.9)}{0.2} \\
&=30.914
\end{align*}
- If the spacing is not equal (to make DD impossible), again creating an interpolation may be close enough.
- If data is noisy, regressing and then solving reduces random error.
## Integrals
If you can represent a function as an $n$-th order polynomial, you can approximate the integral with the integral of that polynomial.
### Trapezoidal rule
The **trapezoidal rule** looks at the first order polynomial and
From $a$ to $b$, if there are $n$ trapezoidal segments, where $h=\frac{b-a}{n}$ is the width of each segment:
$$\int^b_af(x)dx=\frac{b-a}{2n}[f(a)+2(\sum^{n-1}_{i=1}f(a+ih))+f(b)]$$
The error for the $i$th trapezoidal segment is $|E_i|=\left|\frac{h^3}{12}\right|f''(x)$. This can be approximated with a maximum value of $f''$:
$$\boxed{|E_T|\leq(b-a)\frac{h^2}{12}M}$$
### Simpson's 1/3 rule
This uses the second-order polynomial with **two segments**. Three points are usually used: $a,\frac{a+b}{2},b$. Thus for two segments:
$$\int^b_af(x)dx\approx\frac h 3\left[f(a)+4f\left(\frac{a+b}{2}\right)+f(b)\right]$$
For an arbitrary number of segments, as long as there are an **even number** of **equal** segments:
$$\int^b_af(x)dx=\frac{b-a}{3n}\left[f(x_0)+4\sum^{n-1}_{\substack{i=1 \\ \text{i is odd}}}f(x_i)+2\sum^{n-2}_{\substack{i=2 \\ \text{i is even}}}f(x_i)+f(x_n)\right]$$
The error is:
$$|E_T|=(b-a)\frac{h^4}{180}M$$
## Ordinary differential equations
### Initial value problems
These problems only have results for one value of $x$.
**Euler's method** converts the function to the form $f(x,y)$, where $y'=f(x,y)$.
!!! example
$y'+2y=1.3e^{-x},y(0)=5\implies f(x,y)=1.3e^{-x}-2y,y(0)=5$
Where $h$ is the width of each estimation (lower is better):
$$y_{n+1}=y_n+hf(x_n,y_n)$$
!!! example
If $f(x,y)=2xy,h=0.1$, $y_{n+1}=y_n+h2x_ny_n$
$$
y(1.1)=y(1)+0.1×2×1×\underbrace{y(1)}_{1 via IVP}=1.2 \\
y(1.2)=y(1.1)+0.1×2×1.1×\underbrace{y(1.1)}_{1.2}=1.464
$$
**Heun's method** uses Euler's formula as a predictor. Where $y^*$ is the Euler solution:
$$y_{n+1}=y_n+h\frac{f(x_n,y_n)+f(x_{n+1},y^*_{n+1}}{2}$$
!!! example
For $f(x,y)=2xy,h=0.1, y(1)=1$:
Euler's formula returns $y^*_{n+1}=y_n+2hx_ny_n\implies y^*(1.1)=1.2$.
Applying Heun's correction:
\begin{align*}
y(1.1)&=y(1)=0.1\frac{2×1×y(1)+2×1.1×y^*(1.1)}{2} \\
&=1+0.1\frac{2×1×1+2×1.1×1.2}{2} \\
&=1.232
\end{align*}
The **Runge-Kutta fourth-order method** is the most accurate of the three methods:
$$y_n+1=y_n+\frac 1 6(k_1+2k_2+2k_3+k_4)$$
- $k_1=hf(x_n,y_n)$
- $k_2=hf(x_n+\tfrac 1 2h,y_n+\tfrac 1 2k_1)$
- $k_3=hf(x_n+\tfrac 1 2 h, y_n+\tfrac 1 2 k_2)$
- $k_4=hf(x_n+h,y_n+k_3)$
### Higher order ODEs
Higher order ODEs can be solved by reducing them to first order ODEs by creating a system of equations. For a second order ODE: Let $y'=u$.
$$
y'=u \\
u'=f(x,y,u)
$$
For each ODE, the any method can be used:
$$
y_{n+1}=y_n+hu_n \\
u_{n+1}=u_n+hf(x_n,y_n,u_n)
$$
!!! example
For $y''+xy'+y=0,y(0)=1,y'(0)=2,h=0.1$:
\begin{align*}
y'&= u \\
u'&=-xu-y \\
y_1&=y_0+0.1u_0 \\
&=1+0.1×2 \\
&=1.2 \\
\\
u_1&=u_0+0.1×f(x_0,y_0,u_0) \\
&=u_0+0.1(-x_0u_0-y_0] \\
&=2+0.1(-0×2-1) \\
&=1.9
\end{align*}
### Boundary value problems
The **finite difference method** divides the interval between the boundary into $n$ sub-intervals, replacing derivatives with their first principles representations. Solving each $n-1$ equation returns a proper system of equations.
!!! example
For $y''+2y'+y=x^2, y(0)=0.2,y(1)=0.8,n=4\implies h=0.25$:
$x_0=0,x_1=0.25,x_2=0.5,x_3=0.75,x_4=1$
Replace with first principles:
$$\frac{y_{i+1}-2y_i+y_{i-1}{h^2}+2\frac{y_{i+1}-y_i}{h}+y_i=x_i^2$$

View File

@ -1,552 +0,0 @@
# ECE 205: Advanced Calculus 1
## Laplace transform
The Laplace transform is a wonderful operation to convert a function of $t$ into a function of $s$. Where $s$ is an unknown variable independent of $t$:
$$
\mathcal L\{f(t)\}=F(s)=\int^\infty_0e^{-st}f(t)dt, s > 0
$$
??? example
To solve for $\mathcal L\{\sin(at)\}$:
\begin{align*}
\mathcal L\{f(t)\}&=\int^\infty_0e^{-st}\sin(at)dt \\
\\
\text{IBP: let $u=\sin(at)$, $dv=e^{-st}dt$:} \\
&=\lim_{B\to\infty} \underbrace{\biggr[
\cancel{-\frac 1 se^{-st}\sin(at)}}_\text{0 when $s=0$ or $s=\infty$}+\frac a s\int e^{-st}\cos(at)dt
\biggr]^B_0 \\
&=\frac a s\lim_{B\to\infty}\left[\int e^{-st}\cos(at)dt \right]^B_0 \\
\text{IBP: let $u=\cos(at)$, $dv=e^{-st}dt$:} \\
&=\frac a s \lim_{B\to\infty}\left[
-\frac 1 s e^{-st}\cos(at)-\frac a s\underbrace{\int e^{-st}\sin(at)dt}_{\mathcal L\{\sin(at)\}}
\right]^B_0 \\
&=\frac{a}{s^2}-\frac{a^2}{s^2}\mathcal L\{\sin(at)\} \\
\mathcal L\{\sin(at)\}\left(1+\frac{a^2}{s^2}\right)&=\frac{a}{s^2} \\
\mathcal L\{\sin(at)\}&=\frac{a}{a^2+s^2}, s > 0
\end{align*}
A **piecewise continuous** function on $[a,b]$ is continuous on $[a,b]$ except for a possible finite number of finite jump discontinuities.
- This means that any jump discontinuities must have a finite limit on both sides.
- A piecewise continuous function on $[0,\infty)$ must be piecewise continuous $\forall B>0, [0,B]$.
The **exponential order** of a function is $a$ if there exist constants $K, M$ such that:
$$|f(t)|\leq Ke^{at}\text{ when } t\geq M$$
!!! example
- $f(t)=7e^t\sin t$ has an exponential order of 1.
- $f(t)=e^{t^2}$ does not have an exponential order.
### Linearity
A **piecewise continuous** function $f$ on $[0,\infty)$ of an exponential order $a$ has a defined Laplace transform for $s>a$.
Laplace transforms are **linear**. If there exist LTs for $f_1, f_2$ for $s>a_1, a_2$, respectively, for $s=\text{max}(a_1, a_2)$:
$$\mathcal L\{c_1f_1 + c_2f_2\} = c_1\mathcal L\{f_1\} + c_2\mathcal L\{f_2\}$$
??? example
We find the Laplace transform for the following.
$$
f(t)=\begin{cases}
1 & 0\leq t < 1 \\
e^{-t} & t\geq 1
\end{cases}
$$
Clearly $f(t)$ is piecewise ocontinuous on $[0,\infty)$ and has an exponential order of -1 when $t\geq 1$ and 0 when $0\leq t<1$. Thus $\mathcal L\{f(t)\}$ is defined for $s>0$.
\begin{align*}
\mathcal L\{f(t)\}&=\int^1_0 e^{-st}dt + \int^\infty_1e^{-st}e^{-t}dt \\
\tag{$s\neq 0$}&=\left[-\frac 1 s e^{-st}\right]^1_0 + \int^\infty_1e^{t(-s-1)}dt \\
&=-\frac 1 se^{-s}+\frac 1 s + \lim_{B\to\infty}\left[ \frac{1}{-s-1}e^{t(-s-1)} \right]^B_1 \\
\tag{$s\neq 0,s>-1$}&=\frac{-e^{-s}+1}{s} -\frac{e^{-s-1}}{-s-1}
\end{align*}
We solve for the special case $s=0$:
\begin{align*}
\mathcal L\{f(t)\}&=\int^1_0 e^{0}dt + \int^\infty_1e^{-st}e^{-t}dt \\
&=1 -\frac{e^{-s-1}}{-s-1} \\
\end{align*}
$$
\mathcal L\{f(t)\}=
\begin{cases}
\frac{-e^{-s}+1}{s}-\frac{e^{-s-1}}{-s-1} & s\neq 0, s>-1 \\
1-\frac{e^{-s-1}}{-s-1} &s=0
\end{cases}
$$
If there exists a transform for $s>a$, the original function multiplied by $e^{-bt}$ exists for $s>a+b$.
$$\mathcal L\{f(t)\}=F(s), s>a\implies \mathcal L\{e^{-bt}f(t)\}=F(s),s>a+b$$
### Inverse transform
The inverse is found by manipulating the equation until you can look it up in the [Laplace Table](#resources).
The inverse transform is also **linear**.
### Inverse of rational polynomials
If the transformed function can be expressed as a partial fraction decomposition, it is often easier to use linearity to reference the table.
$$\mathcal L^{-1}\left\{\frac{P(s)}{Q(s)}\right\}$$
- $Q, P$ are polynomials
- $\text{deg}(P) > \text{deg}(Q)$
- $Q$ is factored
??? example
\begin{align*}
\mathcal L^{-1}\left\{\frac{s^2+9s+2}{(s-1)(s^2+2s-3)}\right\} &=\mathcal L^{-1}\left\{\frac{A}{s-1}+\frac{B}{s+3} + \frac{Cs+D}{(s-1)^2}\right\} \\
&\implies A=2,B=3,C=-1 \\
&=2\mathcal L^{-1}\left\{\frac{1}{s-1}\right\} + 3\mathcal L^{-1}\left\{\frac{1}{(s-1)^2}\right\}-\mathcal L^{-1}\left\{\frac{1}{s+3}\right\} \\
&=2e^t+3te^t-e^{-3t}
\end{align*}
### Inverse of differentiable equations
If a function $f$ is continuous on $[0,\infty)$ and its derivative $f'$ is piecewise continuous on $[0,\infty)$, for $s>a$:
$$
\mathcal L\{ f'\}=s\mathcal L\{f\}-f(0) \\
\mathcal L\{ f''\} = s^2\mathcal L\{f\}-s\cdot f(0)-f'(0)
$$
### Solving IVPs
Applying the Laplace transform to both sides of an IVP is valid to remove any traces of horrifying integration.
!!! example
\begin{align*}
y''-y'-2y=0, y(0)=1, y'(0)=0 \\
\mathcal L\{y''-y'-2y\}&=\mathcal L\{0\} \\
s^2\mathcal L\{y\}-s\cdot y(0)-y'(0) - s\mathcal L\{y\} +y(0) - 2\mathcal L\{y\}&=0 \\
\mathcal L\{y\}(s^2-s-2)-s+1&=0 \\
\mathcal L\{y\}&=\frac{s-1}{(s-2)(s+1)} \\
&= \\
\mathcal L^{-1}\{\mathcal L\{y\}\}&=\mathcal L^{-1}\left\{
\frac 1 3\cdot\frac{1}{s-2} + \frac 2 3\cdot\frac{1}{s+1}
\right\} \\
y&=\frac 1 3\mathcal L^{-1}\left\{\frac{1}{s-2}\right\} + \frac 2 3\mathcal L^{-1}\left\{\frac{1}{s+1}\right\} \\
\tag{from Laplace table}&=\frac 1 3 e^{2t} + \frac 2 3 e^{-t}
\end{align*}
### Heaviside / unit step
The Heaviside and unit step functions are identical:
$$
H(t-c)=u(t-c)=u_c(t)=\begin{cases}
0 & t < c \\
1 & t \geq c
\end{cases}
$$
Piecewise continuous functions can be manipulated into a single equation via the Heaviside function.
For a Heaviside transform $\mathcal L\{u_c(t)g(t)\}$, if $g$ is defined on $[0,\infty)$, $c\geq 0$, and $\mathcal L\{g(t+c)\}$ exists for some $s>s_0$:
$$
\mathcal L\{u_c(t)g(t)\}=e^{-sc}\mathcal L\{g(t+c)\},s>s_0
$$
Likewise, under the same conditions, shifting it twice restores it back to the original.
$$
\mathcal L\{u_c(t)f(t-c)\}=e^{-sc}\mathcal L\{f\}
$$
### Convolution
Convolution is a weird thingy that does weird things.
$$(f*g)(t)=\int^t_0f(\tau)g(t-\tau)d\tau$$
It is commutative ($f*g=g*f$) and is useful in transforms:
$$\mathcal L\{f*g\}=\mathcal L\{f\}\mathcal L\{g\}$$
!!! example
To solve $4y''+y=g(t),y(0)=3, y'(0)=-7$:
\begin{align*}
4\mathcal L\{y''\}+\mathcal L\{y\}&=\mathcal L\{g(t)\} \\
4(s^2\mathcal L\{y\}-s\cdot y(0) - y'(0))+\mathcal L\{y\} &=\mathcal L\{g(t)\} \\
\mathcal L\{y\}(4s^2+1)-12s+28&=\mathcal L\{g(t)\} \\
\mathcal L\{y\}&=\frac{\mathcal L\{g(t)\}}{4s^2+1} + \frac{12s}{4s^2+1} - \frac{28}{4s^2+1} \\
y&=\mathcal L^{-1}\left\{\frac{1}{4s^2+1}\mathcal L\{g(t)\}\right\} + \mathcal L^{-1}\left\{3\frac{s}{s^2+\frac 1 4}\right\}-\mathcal L^{-1}\left\{7\frac{1}{s^2+\frac 1 4}\right\} \\
&= \mathcal L^{-1}\left\{\frac 1 2\mathcal L\left\{\sin\left(\tfrac 1 2 t\right)\right\}\mathcal L\{g(t)\} \right\}+3\cos\left(\tfrac 1 2 t\right)-14\sin\left(\tfrac 1 2t\right) \\
&=\frac 1 2\left(\sin\left(\tfrac 1 2 t\right)*g(t)\right)+3\cos\left(\tfrac 1 2 t\right)-14\sin\left(\tfrac 1 2t\right) \\
&=\frac 1 2\int^t_0\sin(\tfrac 1 2\tau)g(t-\tau)d\tau + 3\cos(\tfrac 1 2 t)-14\sin(\tfrac 1 2 t)
\end{align*}
### Impulse
The **impulse for duration $\epsilon$** is defined by the **dirac delta function**:
$$
\delta_\epsilon(t)=\begin{cases}
\frac 1\epsilon & \text{if }0\leq t\leq\epsilon \\
0 & \text{else}
\end{cases}
$$
As $\epsilon\to 0, \delta_\epsilon(t)\to\infty$. Thus:
$$
\delta(t-a)=\begin{cases}
\infty & \text{if }t=a \\
0 & \text{else}
\end{cases} \\
\boxed{\int^\infty_0\delta(t-a)dt=1}
$$
If a function is continuous, multiplying it by the impulse function is equivalent to turning it on at that particular point. For $a\geq 0$:
$$\boxed{\int^\infty_0\delta(t-a)dt=g(a)}$$
Thus we also have:
$$\mathcal L\{\delta (t-a)\}=e^{-as}\implies\mathcal L^{-1}\{1\}=\delta(t)$$
## Heat flow
The temperature of a tube from $x=0$ to $x=L$ can be represented by the following DE:
$$\text{temp}=u(x,t)=\boxed{u_t=a^2u_{xx}},0<x<L,y>0$$
Two boundary conditions are requred to solve the problem for all $t>0$ — that at $t=0$ and at $x=0,x=L$.
- $u(x,0)=f(x),0\leq x\leq L$
- e.g., $u(0,t)=u(L,t)=0,t>0$
Thus the general solution is:
$$
\boxed{u(x,t)=\sum^\infty_{n=1}a_ne^{-\left(\frac{n\pi a}{L}\right)^2t}\sin(\frac{n\pi x}{L})} \\
f(x)=\sum^\infty_{n=1}a_n\sin(\frac{n\pi x}{L})
$$
### Periodicity
The **period** of a function is an increment that always returns the same value: $f(x+T)=f(x)$, and its **fundamental period** of a function is the smallest possible period.
!!! example
The fundamental period of $\sin x$ is $2\pi$, but any $2\pi K,k\in\mathbb N$ is a period.
The fundamental periods of $\sin \omega x$ and $\cos\omega x$ are both $\frac{2\pi}{\omega}$.
If functions $f$ and $g$ have a period $T$, then both $af+bg$ and $fg$ also must have period $T$.
#### Manipulating polarity
- even: $\int^L_{-L}f(x)dx=2\int^L_0f(x)dx$
- odd: $\int^L_{-L}f(x)dx=0$
- even × even = even
- odd × odd = even
- even × odd = odd
## Orthogonality
$$\int^L_{-L}\cos(\frac{m\pi x}{L})\sin(\frac{n\pi x}{L})dx=0$$
$$
\int^L_{-L}\cos(\frac{m\pi x}{L})(\frac{n\pi x}{L})dx=\begin{cases}
2L & \text{if }m=n=0 \\
L & \text{if }m=n\neq 0 \\
0 & \text{if }m\neq n
\end{cases}
$$
$$
\int^L_{-L}\sin(\frac{m\pi x}{L}\sin(\frac{n\pi x}{L})dx=\begin{cases}
L & \text{if }m=n \\
0 & \text{if }m\neq n
\end{cases}
$$
Functions are **orthogonal** on an interval when the integral of their product is zero, and a set of functions is **mutually orthogonal** if all functions in the set are orthogonal to each other.
If a Fourier series converges to $f(x)$:
$$f(x)=\frac{a_0}{2} + \sum^\infty_{n=1}\left(a_n\cos(\frac{n\pi x}{L})+b_n\sin(\frac{n\pi x}{L})\right)$$
The **Euler-Fourier** formulae must apply:
$$
\boxed{a_n=\frac 1 L\int^L_{-L}f(x)\cos(\frac{n\pi x}{L})dx} \\
\\
\boxed{b_n=\frac 1 L\int^L_{-L}f(x)\sin(\frac{n\pi x}{L})dx}
$$
!!! example
The Fourier series for the square wave function: $f(x)=\begin{cases}-1 & -\pi < x < 0 \\ 1 & 0 < x < \pi\end{cases}$
The period is clearly $2\pi\implies L=\pi$. $f(x)$ is also odd, by inspection.
\begin{align*}
a_n&=\frac 1\pi\int^\pi_{-\pi}\underbrace{f(x)\cos(\frac{n\pi x}{\pi})}_\text{odd × even = odd}dx=0=a_0 \\
b_n&=\frac 1 \pi\int^\pi_{-\pi}f(x)\sin(\frac{n\pi x}{\pi})dx \\
\tag{even}&=\frac 2\pi\int^\pi_0f(x)\sin(nx)dx \\
\tag{$f(x)>1$ when $x>0$}&=\frac 2\pi\int^\pi_0\sin(nx)dx \\
&=\frac 2\pi\left[\frac{-\cos nx}{n}\right]^\pi_0 \\
&=\begin{cases}
\frac{4}{\pi n} & \text{if $n$ is odd} \\
0 & \text{else}
\end{cases}
\therefore f(x)&=\sum^\infty_{n=1}\frac 2\pi\left(\frac{1-(-1)^n}{n}\sin(nx)\right) \\
\tag{only odd $n$s are non-zero}&=\frac4\pi\sum^\infty_{n=1}\frac{1}{2n-1}\sin[(2n-1)x]
\end{align*}
Thus the Fourier series is $$.
### Separation of variables
To solve IBVPs, where $X(x)$ and $T(t)$ are exclusively functions of their respective variables:
$$u(x,t)=X(x)T(t)$$
Substituting it into the IBVP results in a **separation constant** $-\lambda$.
$$\boxed{\frac{T'(t)}{a^2T(t)}=\frac{X''(x)}{X(x)}=-\lambda}$$
Possible values for the separation constant are known as **eigenvalues**, and their corresponding **eigenfunctions** contain the unknown constant $a_n$:
$$
\lambda_n=\left(\frac{n\pi}{L}\right)^2 \\
X_n(x)=a_n\sin(\frac{n\pi x}{L})
$$
### Wave equation
A string stretched between two secured points at $x=0$ and $x=L$ can be represented by the following IBVP:
$$
u_{tt}=a^2u_{xx},0<x<L,t>0 \\
u(0,t)=u(L,t)=0,t>0 \\
u(x,0)=f(x), 0\leq x\leq L \\
u_t(x,0)=g(x), 0\leq x\leq L
$$
The following conditions must be met:
$$
u(x,t)=\sum^\infty_{n=1}\sin(\frac{n\pi x}{L})\left(\alpha_n\cos(\frac{n\pi a}{L}t)+\beta_n\sin(\frac{n\pi a}{L}t)\right) \\
\boxed{f(x)=\sum^\infty_{n=1}\alpha_n\sin(\frac{n\pi x}{L}),0\leq x\leq L} \\
\boxed{g(x)=\sum^\infty_{n=1}\frac{n\pi a}{L}\beta_n\sin(\frac{n\pi x}{L}), 0\leq x\leq L}
$$
### Fourier symmetry
To find a Fourier series for functions defined only on $[0, L]$ instead of $[-L, L]$, a **periodic extension** can be used.
A **half-range sine expansion (HRS)** is used for odd functions:
$$
f_o(x)=\begin{cases}
f(x) & x\in(0, L) \\
-f(-x) & x\in(-L, 0)
\end{cases}
$$
A **half-range cosine expansion (HRC)** is used for even functions:
$$
f_e(x)=\begin{cases}
f(x) & x\in(0, L) \\
f(-x) & x\in(-L, 0)
\end{cases}
$$
Thus if a Fourier series on $(0,L)$ exists, it can be expressed as either a **Fourier sine series** (via HRS) or a **Fourier cosine series** (via HRC).
!!! example
For $f(x)=\begin{cases}\frac\pi 2 & [0,\frac\pi 2] \\ x-\frac\pi 2 & (\frac\pi2,\pi]\end{cases}$:
\begin{align*}
a_n&=\frac 2 L\int^L_0f(x)\cos(\frac{n\pi x}{L})dx \\
&=\frac 2\pi \int^{\pi/2}_0\frac\pi 2\cos(\frac{n\pi x}{\pi})dx + \frac 2 \pi\int^\pi_{\pi/2}(x-\frac\pi2)\cos(\frac{n\pi x}{\pi})dx \\
&=\frac{2}{n^2\pi}[(-1)^n-\cos(\frac{n\pi}{2})+\frac{n\pi}{2}\sin(\frac{n\pi}{2}) \\
\\
a_0&=\frac2\pi\int^\pi_0f(x)\cos(0)dx \\
&=\frac{3\pi}{4} \\
\\
\therefore f(x)&=\frac{3\pi}{8}+\sum^\infty_{n=1}\frac{2}{n^2\pi^2}[(-1)^n-\cos(\frac{n\pi}{2})+\frac{n\pi}{2}\sin(\frac{n\pi}{2})]\cos(nx),x\in[0,\pi]
\end{align*}
!!! example
For:
$$
u_t=2u_{xx},0<x<\pi,t:0 \\
u(0,t)=u(\pi,t)=0,t>0 \\
u(x,0)=\begin{cases}
\frac\pi 2 & [0,\frac\pi 2] \\
x-\frac\pi 2 & (\frac\pi 2,\pi]
\end{cases}
$$
We have $L=\pi,a=\sqrt 2$.
\begin{align*}
u(x,t)&=\sum^\infty_{n=1}\alpha_ne^{\left(\frac{n\pi\sqrt 2}{\pi}\right)^2t}\sin(\frac{n\pi x}{\pi})
&=\sum^\infty_{n=1}\alpha_ne^{-2n^2t}\sin(nx) \\
\alpha_n&=\frac 2 L\int^L_0f(x)\sin(\frac{n\pi x}{L})dx \\
&=\frac2\pi\int^{\pi/2}_0\frac\pi 2\sin(nx)dx+\frac2\pi\int^\pi_{\pi/2}(x-\frac\pi2\sin(nx)dx \\
&=\frac 1 n[1+(-1)^{n+1}-\cos(\frac{n\pi}{2})-\frac{2}{n\pi}\sin(\frac{n\pi}{2}]
\end{align*}
### Convergence of Fourier series
!!! definition
- $f(x^+)=\lim_{h\to0^+}f(x+h)$
- $f(x^-=\lim_{h\to0^-}f(x+h)$
If $f$ and $f'$ are piecewise continuous on $[-L, L]$ for $x\in(-L,L)$, where $a_n$ and $b_n$ are from the Euler-Fourier formulae:
$$\frac{a_0}{2}+\sum^\infty_{n=1}a_n\cos(\frac{n\pi x}{L})+b_n\sin(\frac{n\pi x}{L})=\boxed{\frac 1 2[f(x^+)+f(x^-)]}$$
At $x=\pm L$, the series converges to $\frac 1 2[f(-L^+)+f(L^-)]$. This implies:
- A continuous $f$ converges to $f(x)$
- A discontinuous $f$ has the Fourier series converge to the average of the left and right limits
- Extending $f$ to infinity using periodicity allows it to hold for all $x$
!!! example
The square wave function $f(x)=\begin{cases}-1 & -\pi<x<0 \\ 1 & 0<x<\pi\end{cases},f(x+2\pi)=f(x)$:
$f$ and $f'$ are piecewise continuous, but the function is discontinuous at $k\pi,k\in\mathbb Z$. Thus at $x=\pm\pi$, the series converges to $\frac 1 2(-1+1)=0$. At $x=0$, the series converges to $\frac 1 2(1+(-1))=0$.
If $f$ is 2L-periodic and continuous on $-\infty,\infty$, and $f'$ is piecewise continuous on $[-L,L]$, the Fourier series converges **uniformly** to $f$ on $[-L,L]$ and thus any interval.
More formally, for every $\epsilon>0$, there exists an integer $N_0$ depending on $\epsilon$ such that $|f(x)-[\frac{a_0}{2}+\sum^N_{n=1}a_n\cos(\frac{n\pi x}{L})+b_n\sin(\frac{n\pi x}{L})]|<\epsilon$ for all $N\geq N_0$ and all $x\in(-\infty,\infty)$.
More intuitively, for a high enough summation of the Fourier series, the value must lie in an **$\epsilon$-corridor** of $f(x)$ such that $f(x)$ is always between $f(x)\pm\epsilon$.
!!! example
- The Fourier series for the triangle wave function **is** uniformly convergent.
- The Fourier series for the square wave function **is not** uniformly convergent, which means that Gibbs overshoots would not fit in an arbitrarily small $\epsilon$-corridor.
The **Weierstrass M-test** states that if $|a_n(x)|\leq M_n$ for all $x\in[a,b]$ and if $\sum^\infty_{n=1}M_n$ converges, then $\sum^\infty_{n=1}a_n(x)$ converges uniformly to $f(x)$ on $[a,b]$.
!!! example
$\sum^\infty_{n=1}\frac{1}{n^2}\cos(nx)$ converges uniformly on any finite closed interval $[a,b]$.
$|\frac{\cos(nx)}{n^2}|\leq\frac{1}{n^2}$ for all $x$, and $\sum^\infty_{n=1}\frac{1}{n^2}$ also converges. Thus the result follows from the M-test.
### Differentiating Fourier series
You can termwise differentiate the Fourier series of $f(x)$ only if:
- $f(x)$ is continuous on $(-\infty,\infty)$ and 2L-periodic
- $f'(x),f''(x)$ are both piecewise continuous on $[-L,L]$
You can termwise integrate the Fourier series of $f(x)$ only if $f(x)$ is piecewise continuous on $[-L,L]$.
Then, for any $x\in[-L,L]$:
$$\int^x_{-L}f(t)dt=\int^x_{-L}\frac{a_0}{2}dt+\sum^\infty_{n=1}\int^x_{-L}(a_n\cos(\frac{n\pi t}{L})+b_n\sin(\frac{n\pi t}{L}))dt$$
### Complex Fourier series
By employing Euler's theorem, sine and cosine can be transformed into exponential forms.
$$
\cos(\frac{n\pi x}{L})=\frac{e^{i\frac{n\pi x}{L}} + e^{-i\frac{n\pi x}{L}}}{2} \\
\sin(\frac{n\pi x}{L})=\frac{-ie^{i\frac{n\pi x}{L}} + ie^{-i\frac{n\pi x}{L}}}{2}
$$
Thus the **complex Fourier series** is given by:
$$
f(x)=\sum^\infty_{n=-\infty}c_ne^{i\frac{n\pi x}{L}} \\
c_n=\frac{1}{2L}\int^L_{-L}f(x)e^{-i\frac{n\pi x}{L}}dx = \frac 1 2(a_n-ib_n)
$$
To convert it to a real Fouier series:
- $a_0=2c_0$
- $a_n=c_n+\overline{c_n}$
- $b_n=i(c_n-\overline{c_n})$
!!! example
The complex Fourier series for the sawtooth wave function: $f(x)=x,-1<x<1,f(x+2)=f(x)$. Thus we have a period of 2 and $L=1$.
\begin{align*}
c_0&=\frac 1 2\int^1_{-1}\underbrace{xe^{0}}_\text{odd}dx \\
&=0 \\
\\
c_n&=\frac 1 2\int^1_{-1}xe^{-in\pi x}dx \\
\tag{IBP}&=\frac 1 2\left[\frac{xe^{-in\pi x}}{-in\pi}-\int\frac{1}{-in\pi}e^{-in\pi x}dx\right]^1_{-1} \\
&=\frac 1 2\left[\frac{xe^{-n\pi x}}{-in\pi}+\frac{1}{n^2\pi^2}e^{-in\pi x}\right]^1_{-1} \\
&=\frac{(-1)^ni}{n\pi} \\
\\
\therefore f(x)&=\sum^\infty_{\substack{n=-\infty \\ n\neq0}}\frac{(-1)^ni}{n\pi}e^{in\pi x}
\end{align*}
The Fourier coefficients $c_n$ map to the amplitude spectrum $|c_n|$. **Parseval's theorem** maps the frequency domain ($\{c_n\}$) to and from the time domain ($f(t)$):
If a 2L-periodic function $f(t)$ has a complex Fourier series $f(t)=\sum^\infty_{n=-\infty}c_ne^{\frac{in\pi x}{L}}$:
$$\frac{1}{2L}\int^L_{-L}\underbrace{[f(t)]^2}_\text{time domain}dt=\sum^\infty_{n=-\infty}\underbrace{|c_n|^2}_\text{time domain}$$
!!! example
For the Sawtooth function, $f(t)=t, -1 < t < 1, f(t+2)=f(t)$:
\begin{align*}
f(x)&=\sum^\infty_{\substack{n=-\infty \\ n\neq 0}}\frac{ni}{n\pi}e^{in\pi t}+0 \\
\frac 1 2\int^1_{-1}t^2dt&=\sum^\infty_{\substack{n=-\infty \\ n\neq 0}}\left|\frac{(-1)^ni}{n\pi}\right|^2+|0|^2 \\
\tag{$\left|\frac{(-1)^ni}{n\pi}\right|=\frac{1}{n\pi}$}\frac 1 3 &=\sum^\infty_{\substack{n=-\infty \\ n\neq 0}}\left(\frac{1}{n\pi}\right)^2 \\
&=\sum^{-1}_{n=-\infty}\left(\frac{1}{n\pi}\right)^2+\sum^\infty_{n=1}\left(\frac{1}{n\pi}\right)^2 \\
\tag{$\frac 1 n^2$ sign doesn't matter}&=2\sum^\infty_{n=1}\frac{1}{n^2\pi^2} \\
\frac 1 3 &=\frac{2}{\pi^2}\sum^\infty_{n=1}\frac{1}{n^2} \\
\frac{\pi^2}{6}&=\sum^\infty_{n=1}\frac{1}{n^2}
\end{align*}
### Fourier transform
To convert a function to a Fourier series:
$$\mathcal F\{f(x)\}=\hat f(\omega)=\int^\infty_{-\infty}f(x)e^{-i\omega x}dx$$
To convert a Fourier series back to the original function, the following conditions must hold:
- there must not be any infinite discontinuities: $\int^\infty_{-\infty}|f(x)|dx<\infty$
- in any finite interval, there must be a finite number of extrema and discontinuities
Then, the **Fourier integral** / **inverse Fourier transform** converges to $f(x)$ wherever continuous and $\frac 1 2[f(x^+)+f(x^-)]$ at discontinuities.
$$\mathcal F^{-1}\{\hat f(\omega)\}=f(x)=\frac{1}{2\pi}\int^\infty_{-\infty}\hat f(\omega)e^{i\omega x}d\omega$$
!!! example
For $f(x)=\begin{cases} 1 & -1<x<1 \\ 0 & \text{else}\end{cases}$:
\begin{align*}
\mathcal F\{f(x)\}&=\int^\infty_{-\infty}f(x)e^{-i\omega x}dx \\
&=\int^1_{-1}e^{-i\omega x}dx \\
&=\frac{i\omega}(e^{i\omega}-e^{-i\omega}) \\
&=\frac{2\sin\omega}{\omega}
\end{align*}
Parseval's theorem can be generalised to non-periodic situations via Fourier transforms.
$$\int^\infty_{-\infty}[f(t)]^2dt=\frac{1}{2\pi}\int^\infty_{-\infty}|\hat f(\omega)|^2d\omega$$
#### Properties of the Fourier transform
- FT/IFT are linear: $\mathcal F\{af+bg\}=a\mathcal F\{f\}+b\mathcal F\{g\}$
- FT is scalable: $\mathcal F\{f(ax)\}=\frac 1 a\hat f\left(\frac{\omega}{a}\right)$
- FT can shift frequencies: $\mathcal F\{e^{iax}f(x)\}=\hat f(\omega-a)$
- FT can shift time: $\mathcal F\{f(x-a)\}=e^{ia\omega}\hat f(\omega)$
- If the IFT is applicable: $\mathcal F\{f^{(n)}(x)\}=(i\omega)^n\hat f(\omega)$
- The FT is symmetrical: $\mathcal F\{\hat f(x)\}=2\pi f(-\omega)$
## Resources
- [Laplace Table](/resources/ece/laplace.pdf)

View File

@ -1,211 +0,0 @@
# ECE 222: Digital Computers
## Exceptions
In ARM, anything that interrupts the normal control flow of a program is an exception.
- An **interrupt** from an **interrupt request (IRQ)** occurs when a peripheral wants to interrupt the current flow
- A **fault** indicates a CPU error (e.g., division by zero) and returns to the faulty instruction
- A **trap** runs the interrupt handler and returns to the next instruction
Exceptions are handled by running an exception handler then returning to the original line.
### Vector table
A vector table is an array of handler addresses. Each index contains a number (a "vector") and a priority.
### Exception handling
First, in hardware: If the exception priority is higher than the current operating priority, the exception is immediately handled.
- the current context is pushed to the stack
- the operating mode is set to privileged
- the operating priority is set to the exception priority
- the program counter is set to the address of the exception (`vector_table[exception_num]`)
Next, the handler runs, and it should:
- preserve the any R4-R11 it modifies
- clear the interrupt request (IRQ)
- restore R4-R11
- return with `BX LR`
Finally, in hardware:
- the previous context is restored
- the previous operating priority and mode are restored
!!! warning
Interrupts can interrupt other interrupts, if their priority is sufficiently high!
!!! example
How to interrupt-driven I/O:
**Write the ISR:** Assuming that the IRQ bit is cleared if `R0` is read:
```asm
ISR PUSH {R4-R11} ; save previous state onto stack
LDR R3, [R0] ; clear the IRQ by reading from it
POP {R4-R11} ; restore state
BX LR ; return to original address
```
**Store the interrupt handler in the vector table:** Assuming that the vector number is `22` and the vector table starts 16 addresses after the 0x00:
```asm
MOV32 R0, #ISR ; handler address
MOV R1, #38 * 4 ; offset: (16 + 22) * 4 bytes per address
STR R1, [R0] ; save address to table
```
**Enable interrupt requests:**
```asm
MOV32 R0, #ADDRESS_INTERRUPT_ENABLE
MOV R1, #1
STR R1, [R0] ; enable interrupts
```
## Processor design
Comparing the **complex instruction set computer** architecture to the **reduced instruction set computer** architecture:
| Task | CISC | RISC |
| ---- | ---- | ---- |
| ALU operands can come from? | registers, memory | registers (load/store) |
| Addressing mode | complex | simple |
| Binary size | small | large (~30% larger) |
| Instruction size | variable | fixed |
| Pipelining | difficult | simple |
### Operation encoding
The **R-format** is used for operations of the form `ADD Rd, Rn, Rm`:
$$\underbrace{\text{op-code}}_\text{11 b}\ \ \overbrace{\text{Rm}}^\text{5 b}\ \ \underbrace{\text{shift amount}}_\text{6 b}\ \ \overbrace{\text{Rn}}^\text{5 b}\ \ \underbrace{\text{Rd}}_\text{5 b}$$
The **D-format** is used for operations of the form `LDR Rt, [Rn, #offset]`:
$$\underbrace{\text{op-code}}_\text{11 b}\ \ \overbrace{\text{offset}}^\text{9 b}\ \ 00\ \ \overbrace{\text{Rn}}^\text{5 b}\ \ \underbrace{\text{Rt}}_\text{5 b}$$
The **CB-format** is used for operations of the form `CBZ Rt, LABEL`:
$$\underbrace{\text{op-code}}_\text{8 b}\ \ \overbrace{\text{offset}}^\text{19 b}\ \ \underbrace{\text{Rt}}_\text{5 b}$$
### Instruction data path
To execute an instruction, the following steps are observed:
1. Instruction fetch (IF)
- fetch the instruction from instruction memory
- increment the instruction address (`PC += 4`), latchedd into PC register at the end of the CPU cycle
2. Instruction decode (ID)
- decode fields like the op-code, offset
- read recoded registers
3. Execute (EX)
- ALU calculates ADD, SUB, etc, as well as addresses for LDR/STR, sets zero status for CBZ
- branch adder calculates any branch target addresses
4. Memory (ME)
- if memory needs to be reached, either `Write` or `Read` must be asserted to prepare for it
- write to memory
5. Writeback (WB)
- write results to registers from memory, the ALU, or another register
### Performance
Each step in the instruction data path has a varying time, so the clock period must be at least as long as the slowest step.
Performance is usually compared by comparing the execution times of standard benchmarks, such that:
$$\text{time}=n_{instructions}\times\underbrace{\frac{\text{cycles}}{\text{instruction}}}_\text{CPI}\times\frac{\text{seconds}}{\text{cycle}}$$
## Pipelining
Pipelining changes the granularity of a clock cycle to be per step, instead of per-instruction. This allows multiple instructions to be processed concurrently.
<img src="https://upload.wikimedia.org/wikipedia/commons/c/cb/Pipeline%2C_4_stage.svg" width=500>(Source: Wikimedia Commons)</img>
### Data forwarding
If data needs to be used from a prior operation, a pipeline stall would normally be required to remove the hazard and wait for the desired result (a **read-after-write** data hazard). However, a processor can mitigate this hazard by allowing the stalled instrution to read from the prior instruction's result instead.
### Load hazards
If a value is produced in memory access (e.g., loads) that is required in the next instruction's EX. a stall is for the dependent instruction. This can be detected in the ID stage by testing if the current instruction sets the memory read flag and the next instruction accesses the destination register.
A processor **stalls** by disabling the PC and IF/ID write to prevent fetching the next instruction. Additionally, it sets the control in ID/EX to 0 to insert a no-op in the pipeline.
## Memory
### Static RAM (SRAM)
- retains data as long as power is supplied
- compared to DRAM, it is faster but more expensive, so it is used for cache
- To **read**: set word line = 1, turning on transistors, then read the **bit line**'s voltage
- To **write**: set word line = 1, turning on transistors, then drive the **bit line**'s voltage
<img src="https://2.bp.blogspot.com/-dCCrTGB-c6U/T1zaY5TG1oI/AAAAAAAAAu8/MutoYbjglvs/s640/SRAM.gif" width=500 />
### Dynamic RAM (DRAM)
- DRAM capacitors lose their charge over time so must be periodically **refreshed**
- Roughly 5x slower than SRAM, but cheaper, so it is used for main memory
- To **read**: precharge the bit line to $V_{DD}/2$, then set word line = 1, then sense and amplify the voltage change on the bit line. This also writes back the value.
- To **write**: along the bit line, drive $V_DD$ to charge the capacitor (write a $1$) or $GND$ to discharge (write a $0$).
<img src="https://www.electronics-notes.com/images/ram-dynamic-dram-basic-cell-01.svg" width=500 />
### Large DRAM chips
Each bit cell is placed into a symmetric 2D matrix to avoid linear searching. Assuming each addressing pin can address one byte (8 bits), including one bit to select row or column:
$$\text{\# addr bits} = \log_2(2\times\text{\# bytes})$$
The matrix would store a total of eight times the number of bytes / words, so each edge is the square root of that. To read an address, the memory controller gives the row on the address pins and asserts **row address strobe (RAS)**. After the row is read, the controller gives the column and asserts **column address strobe (CAS)**.
$$
\text{\# bits} = 2\times\text{\# bytes}\times\frac{\pu{8 bits}}{\pu{1 word}} \\
\text{matrix length}=\sqrt{\text{\# bits}}
$$
!!! example
A 16 Mib machine stores 2 MiB, or $1024^2$ bytes. Thus the bits are arranged in a $\sqrt{2\times1024^2\times8}=2^{12}$ by $2^{12}$ matrix, where each row holds $2^9$ 8-bit words.
### DRAM timing
**Asynchronous** DRAM:
1. Provide row number, assert RAS
2. Wait
3. Provide column number, assert CAS
4. Wait
5. Transfer data
**Fast page mode** DRAM:
1. Provide row number
2. Specify multiple column numbers
3. Transfer multiple data
**Synchronous** DRAM (SDRAM) synchronises commands and data transfers to the bus clock. A row is buffered, then data is transferred in bursts of 2<sup>n</sup> words.
**Double data rate** SDRAM transfers data on the rising and falling edges of the bus clock.
### DRAM performance
!!! definition
- **Latency** is measured by the time from the start of the request to the start of data transfer.
- **Bandwidth** is measured by the volume of data transferred per unit time
**DDR SDRAM** transfers 64 bits per channel at once. A **rank** of memory chips provides the data, and each rank chip is mounted on a **dual inline memory module (DIMM)**. To increase capacity without increasing latency, each rank is subdivided into **banks**.
As a JEDEC standard, chips are named by DDR generation and bandwidth:
$$
\text{PC}\#-bandwidth
$$
!!! example
A **PC3-12800** chip is DDR3 with a bus transfer rate of 12800 MB/s. Or, at 8 B/transfer, a bus clock rate of 1600 MT/s. At 2 transfers/cycle (DDR), it must thus run at 800 MHz.

View File

@ -1,223 +0,0 @@
# ECE 240: Electronic Circuits
## Diodes
A **diode** is a two-terminal device that only allows current to flow in the direction of the arrow.
<img src="https://upload.wikimedia.org/wikipedia/commons/b/b4/Diode_symbol.svg" width=300>(Source: Wikimedia Commons)</img>
The current across a diode is, where $I_s$ is a forced saturation current, $V$ is the voltage drop across it, and $V_T$ is the **thermal voltage** such that $V_T=\frac{kT}{q}$, where $T$ is the temperature, $k$ is the Boltzmann constant, and $q$ is the charge of an electron:
$$I=I_s\left(e^{V/V_T}-1\right)$$
!!! tip
- $V_T\approx\pu{25 mV}$ at 20°C
- $V_T\approx\pu{20 mV}$ at 25°C
A diode is open when current is flowing reverse the desired direction, resulting in zero current, until the voltage drop becomes so great that it reaches the **breakdown voltage** $V_B$. Otherwise, the above current formula is followed.
<img src="https://upload.wikimedia.org/wikipedia/commons/2/2a/Diode_current_wiki.png" width=500>(Source: Wikimedia Commons)</img>
Diodes are commonly used in **rectifier circuits** — circuits that convert AC to DC.
By preventing negative voltage, a relatively constant positive DC voltage is obtained. The slight dip between each hill is known as **ripple** $\Delta V$.
<img src="https://upload.wikimedia.org/wikipedia/en/8/8b/Reservoircapidealised.gif" width=500>(Source: Wikimedia Commons)</img>
In a simple series RC circuit, across a diode, Where $R_LC>>\frac 1 \omega$, and $f=\frac{\omega}{2\pi}$:
$$\Delta V\approx \frac{I_\text{load}}{2fC}\approx\frac{V_0}{2fR_LC}$$
### Zener diodes
A Zener diode is a calibrated diode with a known breakdown voltage, $V_B$. If the voltage across the diode would be greater than $V_B$, it is **capped at $V_B$.**
<img src="https://upload.wikimedia.org/wikipedia/commons/9/92/Zener_diode_symbol-2.svg" width=200>(Source: Wikimedia Commons)</img>
## Voltage/current biasing
Solving for current for each element in a series returns a negative linear line and other non-linear lines.
- the linear line is the **load line**, which represents the possible solutions to the circuit when it is loaded
- Depending on the base current $I_s$, the diode or transistor will be **biased** toward one of the curves, and the voltage and current will settle on one of the intersections, or **bias points**.
<img src="https://upload.wikimedia.org/wikipedia/commons/2/27/BJT_CE_load_line.svg" width=600>(Source: Wikimedia Commons)</img>
- To bias current, as $R\to\infty$ (or, in practical terms, $R>>diode$), the slope of the load line $\to 0$, which results in a constant current.
- To bias voltage, as $R\to 0$, the slope of the load line $\to\infty$, which results in a constant voltage.
!!! example
<img src="https://miro.medium.com/v2/resize:fit:432/1*mijJgpHdt7DDmrPsb7tOcg.png" width=200 />
The current across the resistor and the diode is the same:
\begin{align*}
i_D&=\frac{V_s}{R} \\
i_D&\approx I_se^{V_D/V_T}
\end{align*}
If a diode is put in series with AC and DC voltage sources $V_d(t)$ and $V_D$:
\begin{align*}
i_D(t)&=I_se^{(V_D+V_d(t))/V_T} \\
&=\underbrace{I_se^{V_D/V_T}}_\text{bias current}\ \underbrace{e^{V_d(t)/V_T}}_\text{$\approx 1+\frac{V_d}{V_T}$} \\
&=I_D\left(1+\frac{V_d}{V_T}\right) \\
&=\underbrace{I_D}_\text{large signal = bias = DC}+\underbrace{I_D\frac{V_d(t)}{V_T}}_\text{small signal = AC}
\end{align*}
Diodes may act as resistors, depending on the bias current. They may exhibit a **differential resistance**:
$$r_d=\left(\frac{\partial i_D}{\partial v_D}\right)^{-1} = \frac{V_T}{I_D}$$
!!! example
Thus from the previous sequence:
$$i_D(t)=I_D+\frac{1}{r_d}V_d(t)$$
### Signal analysis
1. Analyse DC signals
- assume blocking capacitors are open circuits
- turn off AC sources
2. Analyse AC signals
- assume blocking capacitors are shorts
- turn off DC sources
- replace diode with effective resistor (the differential resistor)
!!! tip
Most $R$s in the circuit can be assumed to be significantly greater than $r_d$, so $r_d$ can be removed in series or $R$ can be removed in parallel.
!!! warning
Oftentimes, turning off a DC source to nowhere is actually a short to ground.
## MOSFETs
A MOSFET is a transistor. Current flows from the drain to the source, and only if voltage is applied to the gate.
<img src="https://upload.wikimedia.org/wikipedia/commons/6/69/Mosfet_saturation.svg" width=500>(Source: Wikimedia Commons)</img>
<img src="https://upload.wikimedia.org/wikipedia/commons/9/91/Transistor_Simple_Circuit_Diagram_with_NPN_Labels.svg" width=300>(Source: Wikimedia Commons)</img>
In strictly DC, current passes the gate if the gate voltage is greater than the threshold voltage $V_G>V_t$. The difference between the two is known as the **overdrive voltage** $V_{ov}$:
$$V_{ov}=V_G-V_t$$
At a small $V_{DS}$, or in AC, the slope of $I_D$ to $V_{DS}$ is proportional to $V_G$. The **channel transconductance** $g_{DS}$ represents this slope, which is constant based on the **transconductance parameter** of the device.
$$\frac{I_D}{V_{DS}}=g_{DS}=k_nV_{ov}$$
Before the saturation region, the current grows exponentially:
$$\boxed{I_s=k_n(V_{ov}-\tfrac 1 2V_{DS})V_{DS}}$$
Afterward, it remains constant, based on the overdrive voltage:
$$\boxed{I_s=\frac 1 2k_nV_{ov}^2}$$
### Common-source amplifiers
<img src="https://upload.wikimedia.org/wikipedia/commons/4/4f/N-channel_JFET_common_source.svg" width=200>(Source: Wikimedia Commons)</img>
Where $V_{out}=V_{DS}$:
<img src="https://media.cheggcdn.com/media/b65/b65d59bd-ac35-4d28-b811-0ad1b5cf5bb6/phpCBbhn6" width=700 />
$|V_{ds}|>|V_{gs}|$ indicates AC voltage gain.
The gain can be modelled with Ohm's law:
$$V_{DS}=V_{DD}-I_DR_D=V_{DD}-\frac 1 2k_n(V_{GS}-V_t)R_D$$
At a certain gate voltage:
\begin{align*}
A_V&=\frac{\partial V_{DS}}{\partial V_{GS}} \\
&=-g_{DS}R_D
\end{align*}
### Small signal analysis
The current from the drain to the source is equal to:
$$i_D=g_mV_{gs}$$
For small signals, a transistor is equivalent to, where $r_0=\frac{1}{\lambda I_D}=\frac{V_A}{I_D}$:
<img src="https://i.stack.imgur.com/EZK7K.png" width=600 />
It can be assumed that the differential resistance is always significantly smaller than any other external resistance: $r_o << R_d$.
To solve for the output resistance of the amplifier, turn off all sources and take the Thevenin resistance $R_{DS}$.
### Common-drain amplifiers / source followers
The input resistance of common amplifiers is infinity.
<img src="https://upload.wikimedia.org/wikipedia/commons/3/30/N-channel_JFET_source_follower.svg" width=200>(Source: Wikimedia Commons)</img>
As $V_{gs}$ is not necessarily zero, dependent sources must be left in when solving for output resistance, and so a small test source at the point of interest is required.
### Common-gate amplifiers
These can be represented by either the T-model or pi-model. The gate of the transistor is grounded.
$$
A_{VO}=g_mR_d \\
G_V=\frac{V_o}{V_{sig}}=g_mR_d\left(\frac{1}{1+g_mR_{sig}}\right)
$$
<img src="https://upload.wikimedia.org/wikipedia/commons/9/99/Common_Gate.svg" width=200 />
<img src="https://upload.wikimedia.org/wikipedia/commons/a/a9/Common_gate_output_resistance.PNG" width=400 />
### Differential pairs
These are used at the input of opamps.
In **differential mode,** assuming $Q_1=Q_2$:
$V_{in}^+=-V_{in}^-=\frac{V_d}{2}$, so the current going down from both gates is equal $i_{gs1}=-i_{gs2}$. This means that node before $R_E$ is effectively ground, so the circuit can be split into two common source circuits.
$$G_D=\frac{V_o^--V_o^+}{V_d}=\frac{R_{C1}g_m}{1}=-\frac{-R_{C1}}{r_m}$$
<img src="https://upload.wikimedia.org/wikipedia/commons/3/3a/Differential_amplifier_long-tailed_pair.svg" width=300 />
In **common mode**:
$V_{in}^+=V_{in}^-$
$$G_{CM}=-\frac{R_D}{r_m+R_S+2R_C}$$
The **common-mode rejection ratio** is:
$$\frac{G_D}{G_{CM}}=1+\frac{2R_C}{r_m+R_s}$$
## MOSFET biasing
To bias a MOSFET:
- the transistor must be on: $V_{GS}>V_t$
- the transistor must be saturated $V_{DS} > (V_{GS}-V_t)$
$$V_{GS}=V_G-R_EI_D$$
This is a negative feedback loop that forces a constant $I_D$.
<img src="https://i.stack.imgur.com/Yxslx.png" width=300 />
With two DC supplies ($-V_{EE}, V_{DD}$), having an $R_G$ results in:
$$I_D=\frac{-V_{EE}}{R_S}-\frac{V_{GS}}{R_S}$$
## PMOS transistors
These have current flowing from the source to the drain. It is effectively equal to an NMOS at all points but with its polarity reversed.
\begin{align*}
\tag{triode}I_D&=k_p\left(|V_{ov}|-\frac 1 2V_{SD}\right)V_{SD} \\
\tag{saturation}I_D&=\frac 1 2 k_p(V_{SG}-|V_{tp}|)^2
\end{align*}
### Frequency dependence
A **parasitic capacitor** from the gate to the source of an NMOS limits the bandwidth (gain). These represent physical limitations of electrodes. At the output, the current through the capacitor can be neglected. At the input, the current through the capacitor dominates.

View File

@ -1,290 +0,0 @@
# ECE 250: DSA
## Solving recurrences
The **master method** is used to solve recurrences. For expressions of the form $T(n)=aT(n/b)+f(n)$:
- If $f(n)=O(n^{\log_b a})$, we have $T(n)=\Theta(n^{\log_b a}\log n)$
- If $f(n) < O(n^{\log_b a})$, we have $T(n)=O(n^{\log_b a})$
- If $f(n) > \Omega(n^{\log_b a})$, and $af(n/b)\leq cf(n), c<0$, we have $T(n)=\Theta(f(n))$
## Heaps
A heap is a binary tree **stored in an array** in which all levels but the lowest are filled. It is guaranteed that the parent of index $i$ is greater than or equal to the element at index $i$.
- the parent of index $i$ is stored at $i/2$
- the left child of index $i$ is stored at $2i$
- the right child of index $i$ is stored at $2i+1$
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c4/Max-Heap-new.svg" width=600>(Source: Wikimedia Commons)</img>
The **heapify** command takes a node and makes it and its children a valid heap.
```rust
fn heapify(&mut A: Vec, i: usize) {
if A[2*i] >= A[i] {
A.swap(2*i, i);
heapify(A, 2*i)
} else if A[2*i + 1] >= A[i] {
A.swap(2*i + 1, i);
heapify(A, 2*i + 1)
}
}
```
Repeatedly heapifying an array from middle to beginning converts it to a heap.
```rust
fn build_heap(A: Vec) {
let n = A.len()
for i in (n/2).floor()..0 { // this is technically not valid but it's much clearer
heapify(A, i);
}
}
```
### Heapsort
Heapsort constructs a heap annd then does magic things that I really cannot be bothered to figure out right now.
```rust
fn heapsort(A: Vec) {
build_heap(A);
let n = A.len();
for i in n..0 {
A.swap(1, i);
heapify(A, 1); // NOTE: heapify takes into account the changed value of n
}
}
```
### Priority queues
A priority queue is a heap with the property that it can remove the highest value in $O(\log n)$ time.
```rust
fn pop(A: Vec, &n: usize) {
let biggest = A[0];
A[0] = n;
*n -= 1;
heapify(A, 1);
return biggest;
}
```
```rust
fn insert(A: Vec, &n: usize, key: i32) {
*n += 1;
let i = n;
while i > 1 && A[parent(i)] < key {
A[i] = A[parent(i)];
i = parent(i);
}
A[i] = k;
}
```
## Sorting algorithms
### Quicksort
Quicksort operates by selecting a **pivot point** that ensures that everything to the left of the pivot is less than anything to the right of the pivot, which is what partitioning does.
```rust
fn partition(A: Vec, left_bound: usize, right_bound: usize) {
let i = left_bound;
let j = right_bound;
while true {
while A[j] <= A[right_bound] { j -= 1; }
while A[i] >= A[left_bound] { i += 1; }
if i < j { A.swap(i, j); }
else { return j } // new bound!
}
}
```
Sorting calls partitioning with smaller and smaller bounds until the collection is sorted.
```rust
fn sort(a: Vec, left: usize, right: usize) {
if left < right {
let pivot = partition(A, left, right);
sort(A, left, pivot);
sort(A, pivot+1, right);
}
}
```
- In the best case, if partitioning is even, the time complexity is $T(n)=T(n/2)+\Theta(n)=\Theta(n\log n)$.
- In the worst case, if one side only has one element, which occurs if the list is sorted, the time complexity is $\Theta(n^2)$.
### Counting sort
If items are or are linked to a number from $1..n$ (duplicates are allowed), counting sort counts the number of each number, then moves things to the correct position. Where $k$ is the size of the counter array, the time complexity is $O(n+k)$.
First, construct a count prefix sum array:
```rust
fn count(A: Vec, K: usize) {
let counter = vec![0; K];
for i in A {
counter[i] += 1;
}
for (index, val) in counter.iter_mut().enumerate() {
counter[index + 1] += val; // ignore bounds for cleanliness please :)
}
return counter
}
```
Next, the prefix sum represents the correct position for each item.
```rust
fn sort(A: Vec) {
let counter = count(A, 100);
let sorted = vec![0; A.len()];
for i in n..0 {
sorted[counter[A[i]]] = A[i];
counter[A[i]] -= 1;
}
}
```
## Graphs
!!! definition
- A **vertex** is a node.
- The **degree** of a node is the number of edges connected to it.
- A **connected graph** is such that there exists a path from any node in the graph to any other node.
- A **connected component** is a subgraph such that there exists a path from any node in the subgraph to any other node in the subgraph.
- A **tree** is a connected graph without cycles.
### Directed acyclic graphs
a DAG is acyclic if and only if there are no **back edges** — edges from a child to an ancestor.
### Bellman-Ford
The Bellman-Ford algorithm allows for negative edges and detects negative cycles.
```rust
fn bf(G: Graph, s: Node) {
let mut distance = Vec::new(INFINITY);
let mut adj_list = Vec::from(G);
distance[s] = 0;
for i in 1..G.vertices.len()-1 {
for (u,v) in G.edges {
if distance[v] > distance[u] + adj_list[u][v] {
distance[v] = distance[u] + adj_list[u][v];
}
}
}
for (u, v) in G.edges {
if distance[v] > distance[u] + adj_list[u][v] {
return false;
}
}
return true;
}
```
### Topological sort
This is used to find the shortest path in a DAG simply by DFS.
```rust
fn shortest_path(G: Graph, s: Node) {
let nodes: Vec<Node> = top_sort(G);
let mut adj_list = G.to_adj_list();
let mut distance = Vec::new(INFINITY);
for v in nodes {
for adjacent in adj_list[v] {
if distance[adjacent] > distance[v] + adjacent[v] {
distance[v] = distance[adjacent] + adjacent[v];
}
}
}
}
```
### Minimum spanning tree
!!! definition
- A **cut** $(S, V-S)$ is a partition of vertices into disjoint sets $S$ and $V-S$.
- An edge $u,v\in E$ **crosses the cut** $(S,V-S)$ if t`he endpoints are on different sides of the cut.
- A cut **respects** a set of edges $A$ if and only if no edge in $A$ crosses the cut.
- A **light edge** is the minimum of all edges that could cross the cut. There can be more than one light edge per cut.
A **spanning tree** of $G$ is a subgraph that contains all of its vertices. An MST minimises the sum of all edges in the spanning tree.
To create an MST:
1. Add edges from the spanning tree to an empty set, maintaining that the set is always a subset of an MST (only "safe edges" are added)
The **Prim-Jarnik algorithm** grows a tree one vertex at a time. $A$ is a subset of the already computed portion of $T$, and all vertices outside $A$ have a weight of infinity if there is no edge.
```rust
// r is the start vertex
fn create_mst_prim(G: Graph, r: Vertex) {
// clean all vertices
for vertex in G.vertices.iter_mut() {
vertex.min_weight = INFINITY;
vertex.parent = None;
}
let Q = BinaryHeap::from(G.vertices); // priority queue
while let Some(u) = Q.pop() {
for v in u.adjacent_vertices.iter_mut() {
if Q.contains(v) && v.edge_to(u).weight < v.min_weight {
v.min_weight = v.edge_to(u).weight;
Q."modify_key"(v);
v.parent = u;
}
}
}
}
```
**Kruskal's algorithm** is objectively better by relying on edges instead.
```rust
fn create_mst_kruskal(G: Graph) -> HashSet<Edge> {
let mut A = HashSet::new();
let mut S = DisjointSet::new(); // vertices set
for v in G.vertices.iter() {
S.add_as_new_set(v);
}
G.edges.sort(|edge| edge.weight);
for (from, dest) in G.edges {
if S.find_set_that_contains(from) != S.find_set_that_contains(dest) {
A.insert((from, to));
let X = S.pop(from);
let Y = S.pop(to);
S.insert({X.union(Y)});
}
}
return A;
}
```
The time complexity is $O(E\log V)$.
### All pairs shortest path
Also known as an adjacency matrix extended such that each point represents the minimum distance from one edge to that other edge.

View File

@ -1 +0,0 @@
# BIOL 240: Microbiology 1

View File

@ -1 +0,0 @@
# ECE 203: Probability

View File

@ -1,2 +0,0 @@
# ECE 207: Signals and Systems

View File

@ -1,22 +0,0 @@
# ECE 208: Discrete Math 2
## Hilbert system rules
**Axioms:**
- $\vdash (A\implies (B\implies A))$
- $\vdash (A\implies (B\implies C))\implies ((A\implies B)\implies (A\implies C))$
- $\vdash (\neg B\implies\neg A)\implies (A\implies B))$
**Inference (MP):**
- $\frac{\vdash A, \vdash A\implies B}{\vdash B}$
**Derived rules:**
- Deduction: $\frac{U\cup \{A\}\vdash B}{U\vdash A\implies B}$
- Contrapositive: $\frac{U\vdash \neg B\implies\neg A}{U\vdash A\implies B}$ (and vice versa)
- Transitivity: $\frac{u\vdash A\implies B, U\vdash B\implies C}{U\vdash A\implies C}$
- Exchange of antecedent: $\frac{U\vdash A\implies (B\implies C)}{U\vdash B\implies (A\implies C)}$
- Double negation: $\frac{U\vdash \neg\neg A}{U\vdash A}$ (and vice versa)
- Reductio ad absurdum: $\frac{U\vdash\neg A\implies false}{U\vdash A}$

View File

@ -1 +0,0 @@
# ECE 224: Embedded

View File

@ -1 +0,0 @@
# ECE 252: Concurrency

View File

@ -1,8 +1,8 @@
# HL English - 1 # HL English - A
The course code for this page is **ENG3UZ**. The course code for this page is **ENG3UZ**.
## Literary techniques/devices ## Literary Techniques/Devices
### Description ### Description
@ -33,7 +33,6 @@ The course code for this page is **ENG3UZ**.
- e.g., *The cat in the hat knows a lot about that!* - e.g., *The cat in the hat knows a lot about that!*
- Cacophony: The use of words and phrases that are harsh to the ear by using consonants that require pressure to to say (e.g., p, b, d, g, k, ch-, sh-). - Cacophony: The use of words and phrases that are harsh to the ear by using consonants that require pressure to to say (e.g., p, b, d, g, k, ch-, sh-).
- e.g., *How much wood could a woodchuck chuck if a woodchuck could chuck wood?* - e.g., *How much wood could a woodchuck chuck if a woodchuck could chuck wood?*
- Catalexis: A line missing a syllable at the end or beginning.
- Consonance: A number of words with the same consonant sound, not at the beginning, that appear close together. - Consonance: A number of words with the same consonant sound, not at the beginning, that appear close together.
- e.g., *Shelley sells shells by the seashore.* - e.g., *Shelley sells shells by the seashore.*
- Dialect: A regional variety of language with spelling, grammar, and pronunciation that differentiates a population from others around them. - Dialect: A regional variety of language with spelling, grammar, and pronunciation that differentiates a population from others around them.
@ -135,69 +134,6 @@ The course code for this page is **ENG3UZ**.
- Theme: The "main idea" or underlying meaning of a literary work, which can be given directly or indirectly. - Theme: The "main idea" or underlying meaning of a literary work, which can be given directly or indirectly.
- e.g., *"Never forget that* you are royalty, *and that hundreds of thousands of souls have suffered and perished so you could become what you are. By their sacrifices, you have been given the comforts you take for granted. Always remember them, so that their sacrifices shall never be without meaning."* (*Eon Fable*, ScytheRider) - e.g., *"Never forget that* you are royalty, *and that hundreds of thousands of souls have suffered and perished so you could become what you are. By their sacrifices, you have been given the comforts you take for granted. Always remember them, so that their sacrifices shall never be without meaning."* (*Eon Fable*, ScytheRider)
## General writing
### Active and passive voice
Active writing involves having the subject of a sentence perform the action, while passive writing involves the subject receiving the action.
!!! example
Active: *Joey mangled the teacher.*<br>
Passive: *The teacher was mangled by Joey.*
### Redundancy
When possible, any words that do not add meaning should not be present.
## Essay writing
An essay is a relatively brief non-fiction piece of writing (can be read in one sitting) that is focused on one subject.
### Types of essays
**Compare and contrast** essays look for similarities and differences between two concepts, objects, or ideas. Arguments are either structured **subject by subject** or **point by point**.
**Cause and effect** essays attempt to establish a causal connection between ideas or events, in essence explaining why something happens/ed.
**Definitional** essays focus on defining a term, idea, or concept.
**Narrative** essays make a point by telling a non-fictional event in the structure of a short story in first person.
- They are usually told chronologically.
- They usually have a purpose/thesis that is stated in the opening sentence.
- Dialogue is permitted in narrative essays.
- They are written with vivid imagery and descriptions to involve the reader with the goal of relating in some way to the thesis.
- Much like fictional stories, they should have conflicts and events.
- They are usually written in first person.
## Essay analysis
### Thesis statement
The thesis statement of an essay is effectively its central assertion, and may appear in different places:
- An **initial** thesis appears within the first paragraph or so.
- A **delayed** thesis appears anywhere else, but often appears at the end of the essay.
- An **inferred** thesis is one that does not appear in the essay at all. It is instead up to the reader to glean an inferred thesis via inference.
### Purpose
Essays may be classified under two general categories — persuasive/argumentative or expository/informative. Persuasive essays argue to convince a reader to take their position, while expository essays aim to explain a topic without bias.
### Audience
The target audience of an essay and those that it would appeal to are useful in determining the point of an essay. Some factors that may indicate the audience include,
- the topic of the essay
- bias of the author
- diction/language used in the essay
- the use of jargon or slang
- the formality of the essay — formal essays are typically more organised and appeal to logic more than informal essays
- literary techniques
- the tone/attitude of the author of the essay via the use of emotionally charged words
## Resources ## Resources
- [Analysis of a Poem](/resources/g11/central-assertion-1.pdf) - [Analysis of a Poem](/resources/g11/central-asserion-1.pdf)
- [Essay Analysis](/resources/g11/essay-analysis.pdf)
- [Literary Criticism Overview](/resources/g11/literary-criticism.pdf)

View File

@ -1,9 +0,0 @@
.md-typeset svg {
max-width: unset !important;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
}

View File

@ -1,600 +0,0 @@
# HL History - 1
The course code for this page is **CHW3MZ**.
## Command terms
The following terms are regularly used by IB and have specific meanings:
- **Analyse**: Break down an idea into its essential elements
- **Compare**: Identify and justify the similarities between ideas
- **Contrast**: Identify and justify the differences between ideas
- **Discuss**: Provide a balanced review with a range of justified opinions or conclusions
- **Evaluate**: Appraise an argument with strengths and limitations
- **Examine**: Consider an argument or concept, revealing its assumptions and interrelations
- **To what extent**: Consider the merits and demerits of an idea or argument with justified opinions or conclusions
## Historiography
Historiography is the study of how history is developed and how historians have viewed history. It helps develop the ability to view events from multiple perspectives and reveals how others might view events in multiple perspectives. The **historical method** outlines the process of making history from start to finish:
- **Questions are asked** about any of the following from controversies, new perspectives, and gaps in history:
- major/minor long-/short-term **causes** of an event
- the **nature** of an event — the purpose of the event, the status of the event
- the immediate/long-term/short-term **impacts** of an event
- the **ethics** of an event
- a hypothetical **counterfactual** version of an event
- **Data is collected** to help answer the questions
- **Data is analysed** to identify patterns and trends via statistics, make judgements using OPCVL, and make comparisons of the main message (content) and PERMS (political, economical, religious, military, social)
- **Arguments are created** with a thesis and critical analyses per argument
- and the **findings are communicated** via any means, including essays, opinion paragraphs, debates, presentations, music, etc.
### Lenses
There are seven main schools of thought historians usually fall under that attempt to explain why history happens.
- The **great people** lens views history with the perspective that individuals create changes, and without those individuals history would be drastically altered. This school focuses on their individual motivations, relationships, etc.
- The **structuralist** lens views history and events as caused by changes in economic structures, technology, ideology, and social norms.
- The **decisionist** lens views history with the perspective that it is the decisions of people that are the cause of events.
- The **Marxist** lens focuses on class conflict — the exploiter and the exploitee and how their conflicts affect history.
- The **Toynbee** lens regards the response of people to crises as the largest cause to historical events.
- The **post-modern** lens states that history reflects the time period it was written in and the intent of the author. This school asserts that there is no historical truth and focuses on how history is shaped and manipulated to serve the agendas and needs of various civilisations.
- The **feminist** lens states that history should reflect the experience of both genders equally. This school particularly focuses on the treatment of and lives of women.
### Historical concepts
There are six key historical concepts that should be taken under consideration in the analysis of history.
- **Change**: how people and events create change, the differences before and after an event, and the nature and pace of the change
- **Continuity**: what doesn't change and to what extent things don't change
- **Causation**: why an event occurred (social, economic, political, etc.), and what factor(s) caused it
- **Consequence**: the long- and short-term effects of an event on society
- **Significance**: why the event matters and the importance of some details over others
- **Perspective**: the different perspectives, why there are different perspectives, and how those perspectives affect the interpretation of history
### Data collection
The abundance of **diverse** data allows for greater perspectives to be gleaned and thus more solutions to a problem. Data and their sources can fall under one of three categories:
- **Primary** data is from an original source with no sources under it — e.g., newspapers, memoirs, photographs, diaries, etc.
- **Secondary** data is an interpretation of a primary source(s) with its own argument — e.g., articles, thesises, documentaries, etc.
- **Tertiary** data compiles secondary sources and should only be used for context — e.g., wikis, textbooks, encyclopedias, etc.
### Logic
!!! definition
- **Logic** is the study of rules of inference and the analysis of arguments.
- A **conclusion** is a proposition that follows all others.
- An **inference** is a connection that acts as a logical leap between a premise and a conclusion.
- **Logically consistent** statements follow the three laws of thought and do not contradict.
- **Logically contradicting** statements do not follow the three laws of thought.
- The **validity** of a statement is its correctness of reasoning via the laws of thought.
- A **sound** argument is of valid form and has a true premise.
- An **argument** is a simple statement or disagreement that attempts to reach a conclusion by proving something true with evidence. Good arguments are sound, valid, clear, and avoids hasty conclusions.
**Aristotle** laid the foundations for the principles of formal logic via the three laws of thought.
- **Law of identity**: everything is identical with itself.
- **Law of noncontradiction**: contradictory statements cannot both be true.
- **Law of excluded middle**: any proposition must either be true or false.
!!! example
- Identity: A football is a football.
- Noncontradiction: If water and oil do not mix, and substance A mixes in water, it must not be oil.
- Excluded middle: The Nintendo Switch must either be or not be a potato.
**Deductive** arguments connect a general statement to a more specific statement based on laws, rules, and/or widely accepted principles.
!!! example
As monkeys like bananas and Lucy is a monkey, Lucy must like bananas.
**Inductive** arguments connect a specific statement to a more general statement based on **empiric** data.
!!! example
As three of the eight billion humans on Earth are mortal, all humans must be mortal.
### Logical fallacies
- An **ad hominem** argument attacks the arguer or anything else instead of the argument.
- e.g., *"You're a Nintendo fanboy; of course you think that."*
- Arguments that **appeal to authority** use the opinion of an authority on a topic is used as evidence to support an argument.
- e.g., *"The President of the United States said that we should inject disinfectant into ourselves, so it must be a good idea!"*
- Arguments that **appeal to emotion** manipulate the recipient's emotions typically via loaded language to win an argument.
- e.g., *"Those island devils have robbed us of our sleep at night — they must be eradicated!"*
- Arguments that **appeal to force** use threats to win an argument.
- e.g., *"I'm right, aren't I?" said the jock, flexing her biceps threateningly.*
- Arguments that **appeal to ignorance** assert a proposition is true because it has not been proven false.
- e.g., *"My laptop must secretly have chips in it that no one can detect from aliens because we don't know if there* aren't *undetectable chips in there."*
- **Bandwagoning or herding** arguments assert that a conclusion is true because it is accepted by most people. This is a result of confirmation bias.
- e.g., *"Ma, everyone else is jumping off that bridge, so why shouldn't I?"*
- A fallacy of **accident** wrongly applies a general rule to a specific exception.
- e.g., *Since surgeons cut people with knives and cutting people with knives is a crime, surgeons are criminals.*
- An argument that **begs the question** has circular reasoning by having premises that assume its conclusion.
- e.g., *Acid must be able to eat through your skin because it is corrosive.*
- **Cherry picking** occurs when evidence that supports the conclusion is pointed out while those that contradict the conclusion are ignored or withheld.
- e.g., *"Look at these perfect cherries — their tree must be in perfect condition!"*
- A fallacy of **converse accident** wrongly applies a specific exception to a general rule.
- e.g., *As the Nintendo Switch, a game console, is portable, all game consoles must be portable.*
- A **complex question**, also known as a trick question, embeds a proposition that is accepted when a direct answer is given to the question.
- e.g., *Have you stopped abusing children yet?*
- Arguments with a **false cause** incorrectly assume a cause to an effect.
- e.g., imagining correlation implies causation.
- **Hasty generalisations** appear in inductive generalisations based on insufficient evidence.
- e.g., *Since the first seven odd numbers are prime or square, all odd numbers must be prime or square.*
- Arguments that **miss the point** provide an irrelevant conclusion that fails to address the issue of the question.
- e.g., *"Is it allowed?" "It should be allowed because it's nowhere near as bad as alcohol."*
- A **non sequitur** is an invalid argument that does not follow the laws of thought.
- e.g., *All humans are mammals. Whales are mammals. Therefore, whales are humans.*
- A **no true Scotsman** (appeal to purity) fallacy takes a generalisation and doubles down to protect it by excluding counterexamples typically via emotionally charged language.
- e.g., *"Although your father is a Scotsman and dances, no* true *Scotsman would dance."*
- Arguments with **recency bias** put greater importance on recent data over historic data.
- e.g., *As GameStop's stock has risen over the past few days dramatically, it will continue to do so.*
- **Red herrings** change the issue of subject away from the original question.
- e.g., *You should support the new housing bill. We can't continue to see people living in the streets; we must have cheaper housing.*
- A **straw man** argument misrepresents the opposing position by making their arguments sound more extreme.
- e.g., *"We should relax laws on immigration." "The instant we let millions of people through our border is when our country falls."*
## Causes of the Chinese Civil War
### Decline of the Manchu Qing Dynasty
**— Long-term structural political**
In the Qing dynasty, from 1861 to 1908, Empress **Cixi** ruled China as an autocrat. Corruption was rampant in Beijing and officials could not control warlords in remote regions. Under Cixi, China became weak and was easily influenced by foreign powers.
### Foreign involvement
**— Long-term structural political**
The influence of foreign powers increased outrage among citizens at the inability of the government to do things and led to greater internal dissent.
The **opium wars** starting from 1839 were two armed conflicts in China between Western powers and the Qing dynasty. Both were won easily by the West due to their superior, more modern military technology. This resulted in China signing a series of what came to be known as "**unfair treaties**" starting with the Treaty of Nanjing in 1842, which ended the First Opium War and gave Hong Kong to Britain "in perpetuity" among other trading concessions.
The **First Sino-Japanese War** (also known as the War or Jiawu) in 18941895 also resulted in Japan's easy victory due to obsolete Chinese military technology.
!!! example
During the First Sino-Japanese War, Cixi took military money and spent it on palace renovations, demonstrating the corruption in and ineffectiveness of the regime.
### Outdated agricultural practices and limited industrial development
**— Long-term structural economic**
!!! context
In 1900, Japan and the United States were major industrial powers and both were steadily modernising.
China's rulers believed that Westerners were barbarians and that nothing could be learned from industrialisation. This contributed to their weak military strength as they fell further behind other countries.
!!! example
By 1914, only ~6 000 km of rail was laid in China while the US had laid ~225 000 km.
Additionally, the population boom meant that demand for food increased, but outdated agricultural practices and technologies could not keep up, resulting in famine.
### Tradition and class structure
**— Long-term structural social**
China operated under a **patriarchy** and had traditions and practices which were thought to be even at the time to be cruel and outdated especially for women.
!!! example
The life expectancy of a city in China (Shenyang, Daoyi) from 1792 to 1867 was less than 40 years for men and about 30 for women.
**Submission to the Qing dynasty** was traditional as well — the Chinese could not marry Manchus nor live in Manchuria.
!!! example
Men were required to wear a queue (a long pigtail behind a shaven forehead) to show subservience to the Manchu Empire.
The **class structure** in China did not change for hundreds of years and old traditions and practices persisted into the 1900s.
- The land peasants worked on belonged to local landlords.
- 80% of the population remained peasants.
- Landlords took a large amount of crops as rent and the government also took a large portion as taxes.
- The burdens from landlords and the government were compounded with natural disasters such as floods and droughts, resulting in famine.
- Landlords could taken peasant women as they wished, force peasants to perform extra duties, and beat them if they were questioned.
### Internal dissent
**— Long-term structural political**
The **Taiping Civil War** from 1850 to 1864 was one of the bloodiest wars ever and the largest conflict of the 19th century. Anti-Manchurian sentiment was high as the people did not like that the Qing dynasty was ruled not by themselves. At the time, they could not marry Manchus, could not settle in Manchuria, and men were required to wear queues as a reminder of submission to Qing rule.
The **Boxer Rebellion** from 1899 to 1901 was caused by an organisation known as the Boxers (due to many of their members practising Chinese martial arts) desiring an end to foreign control in China. To do so, they violenced across northern China targeting foreign property, Christian missionaries, and Chinese Christians. Although initially supported by Cixi, support was split in the country and eventually she accepted help from foreign armies to end the rebellion.
!!! example
The slogan of the Boxers was to "support the Qing government and exterminate foreigners".
### Introduction of progressive ideas and rise of revolutionaries
Sun Yixian
### 1911 revolution
failure of revolution
aftermath of revolution
### Warlords
**— Short-term**
warlords
### Rise of revolutionaries 2: electric boogaloo
**— Short-term**
first united front
screw this history too hard
## Consolidation and maintenance of power in China
### Use of legal methods
In the aftermath of the Chinese Civil War, political pluralism was adopted for the purposes of stability and unification. At the **Chinese People's Political Consultative Conference (PCC)** on 21 September 1949:
- [Mao Zedong](https://en.wikipedia.org/wiki/Mao_Zedong) (Chinese: 毛泽东) was elected Chairman of the People's Republic of China,
- [Zhou Enlai](https://en.wikipedia.org/wiki/Zhou_Enlai) (Chinese: 周恩来) was appointed first premier (prime minister) by Mao,
- a de facto constitution in the form of the Organic Law was adopted, and
- China was divided into six regions with each region under two civilian and two military officers to maintain control
<img src="/resources/images/ccp-hierarchy.png" width=700>(Source: Kognity)</img>
#### Xinjiang
The **reunification campaigns** from 1950 to 1953 consolidated Mao's power across a divided China and allowed him to gain control of its borders.
!!! background
The region of [Xinjiang](https://en.wikipedia.org/wiki/Xinjiang) followed the Qing dynasty, but was semi-independent during the rule of the warlords and the Republic of China. With a population consisting largely of the [Uyghur](https://en.wikipedia.org/wiki/Uyghurs) minority ethnic group as opposed to the [Han](https://en.wikipedia.org/wiki/Han_Chinese) that made up 98% of the population in China, the province was ruled by a coalition government made of local leaders and **Guomindang (GMD)** members at the time of the establishment of the PRC.
The **Chinese Communist Party (CCP)** was concerned that Xinjiang would start a separatist movement against them or become part of the USSR. Upon the CCP's army, the **People's Liberation Army (PLA)** moving into Xinjiang, provincial authorities pledged allegiance to the CCP and the province was fully under their control by 1951. It is referred to as the "Peaceful Liberation of Xinjiang" in Chinese historiography.
In 1955, the region became an [autonomous region](https://en.wikipedia.org/wiki/Autonomous_regions_of_China) of China, granting it a local government and more legislative rights than other provinces.
#### Controlling the population
All citizens were required to belong to a self-sufficient entity known as a *danwei* (Chinese: 单位), or **work unit**. Permission from the work unit was needed to marry or have children. Under the threat of punishment if policy was not followed, everyone was assigned a home a food to eat along with others in their work unit. Regardless of their size, all work units were obligated to provide or share adequate facilities — schools, housing, health care, etc.
A system of **household registration** to identify citizens known as *hukou* (Chinese: 户口) recorded the birth, death, and movement of people as well as their family members, connecting identifiable information to their location of permanent residence. Whether someone was given better benefits by the government was determined by their agricultural status (agricultural or non-agricultural — i.e. rural or urban, non-agricultural was better) and it was virtually impossible to switch to the other. During industrialisation from 1955 onward, Mao used this system to control rural-to-urban migration by way of a certificate on one's registration required to be able to move to urban area.
Public **records** per person known as *dang'an* (Chinese: 档案) contained personal information such as:
- employment records
- physical characteristics
- family background with photos
- transcripts and school records
- achievements, mistakes, and self-criticisms
- political activity, and more
The government and work unit could access these files, instilling a culture of fear into the citizens as the most intrusive form of surveillance.
#### 1954 Constitution
The [constitution](https://en.wikipedia.org/wiki/1954_Constitution_of_the_People%27s_Republic_of_China) was based on the PCC and Organic Law. It established rights such as equality of citizens andbetween Han and minority groups, prohibiting racial discrimination and oppression. It also set up a legal system where all citizens had the right to a fair trial by judges appointed by the government, but this was not genuinely implemented until after Mao.
### Use of force
#### Hundred Flowers Campaign
From 1956 to 1957, the CCP encouraged citizens to express their thoughts of the regime in the [Hundred Flowers Campaign](https://en.wikipedia.org/wiki/Hundred_Flowers_Campaign) (Chinese: 百花齐放), inviting intellectuals to criticise their policies.
!!! quote "Mao Zedong, 1956:"
The policy of letting a hundred flowers bloom and a hundred schools of thought contend is designed to promote the flourishing of the arts and the progress of science.
Initially, people were afraid of being arrested publicly and executed after the events of the Three- and Five- Antis campaigns, but eventually began to provide criticism. By May 1957, millions of letters were openly criticising the government. Rallies in the streets and posters and articles in magazines protested against corruption and censorship.
!!! example
Students at Peking University created a "Democratic Wall" on which they criticised the CCP with posters and letters over their control over intellectuals, the harshness of campaigns against counter-revolutionaries, low living standards, economic corruption and privileges among members of the party.
Mao abandoned the campaign in June 1957 and then began the [Anti-Rightist Campaign](https://en.wikipedia.org/wiki/Anti-Rightist_Campaign) in July where those who provided criticism were not persecuted. It is controversial whether Mao was genuinely surprised by the extent of the criticism or whether the campaign was to identify enemies of the CCP.
!!! definition
In China, a **rightist** was someone who favoured capitalism over communism, but eventually became a label for anyone who disagreed with Mao.
During the Anti-Rightist Campaign from 1957 to 1959, Mao attacked his critics in the Hundred Flowers Campaign, forcing them to take back what they said. Led by [Deng Xiaoping](https://en.wikipedia.org/wiki/Deng_Xiaoping) (Chinese: 邓小平), at least 550 000 citizens were declared rightists — most of them were sent to be re-educated in the countryside via labour reform. The result was that Mao accumulated more power over the party and over China.
#### Force in the Cultural Revolution
!!! background
The [**Cultural Revolution**](https://en.wikipedia.org/wiki/Cultural_Revolution) from 1966 to 1976 was declared by Mao to remove all capitalist and intellectual elements from China. In reality, it was Mao's attempt to remove his rivals in the government — [Liu Shaoqi](https://en.wikipedia.org/wiki/Liu_Shaoqi) (Chinese: 刘少奇) and Deng Xiaoping — believing their successful policies would damage his reputation and ideology, and to revive his cult of personality after the events of the Great Leap Forward.
The "Four Olds" — old ideas, culture, customs, and habits — were denounced and books were burnt, porcelain destroyed, museums ransacked, and heritage sites destroyed.
!!! example
More than 70% of Beijing's cultural artifacts were destroyed in AugustSeptember 1966.
Because religion and intellectuals could change people's minds, Mao directed temples, shrines, and religious statues to be destroyed. Intellectuals such as teachers were tortured, beaten to death, and sent to prison. Priests and the clergy were imprisoned and denounced — religious worship was banned entirely. [Red Guards](https://en.wikipedia.org/wiki/Red_Guards) comprising students from elementary to high school carried out humiliations and attacks as per the social norm because Mao had ordered them to.
!!! info
The **Little Red Book** was a pocket-sized collection of Mao's thoughts, assembled by his propaganda minister, [Lin Biao](https://en.wikipedia.org/wiki/Lin_Biao) (Chinese: 林彪). Published during the Cultural Revolution, it was viewed as the source of all truth and more than a billion copies circulated, second only to the Holy Bible. Members of the Red Guard were required to carry the book with them at all times, and its contents were viewed as the source of all truth.
In addition, landlords, rich peasants, counter-revolutionaries, rightists, and capitalists were all targeted. Due to the vague nature of thse labels, anyone could accuse anyone of anything. An environment of fear formed as people reported suspected enemies, with some citizens reporting neighbours as revenge, and children even reported and condemned their parents. The population was effectively mobilised to act as a **secret police** without actual secret police. Casualties from the Cultural Revolution are difficult to measure and range from thousands to millions.
!!! example
People were accused and persecuted for crimes such as forgetting a quote from the Little Red Book or owning a Western instrument.
#### Tibet
Declaring that Tibet was part of China, on 7 October 1950, the PLA invaded east Tibet under the banner of liberating them from Western imperialist powers, although the Tibet government recorded only ten foreigners in the country. As a poor country with little infrastructure and communications, the poorly equipped and trained Tibetan army of 8 000 was outmatched by the 40 000 sent by the PLA. On 23 May 1951, the CCP imposed on Tibet the [Seventeen Point Agreement for the Peaceful Liberation of Tibet](https://en.wikipedia.org/wiki/Seventeen_Point_Agreement) that confirmed Chinese soverignity over the province.
In 1959, an [uprising in Tibet](https://en.wikipedia.org/wiki/1959_Tibetan_uprising) led to the mass arrests of Tibetans and increased social and religious control. The spiritual leader of Tibetan Buddhism, the [Dalai Lama](https://en.wikipedia.org/wiki/Dalai_Lama), fled to India and some Buddhist practices were forbidden. The Tenth [Panchen Lama](https://en.wikipedia.org/wiki/Panchen_Lama) under the Dalai Lama wrote the [70 000 Character Petition](https://en.wikipedia.org/wiki/70,000_Character_Petition) addressed to the Chinese government, denouncing the abusive policies such as mass imprisonment and the high prisoner death rate in Tibet under communist rule. Mao rejected the claims and arrested him.
#### Guangdong purge
Guangdong (Chinese: 广东), also known as Canton, is a province in southern China close to Hong Kong and Macau and had held an economically important port that was the headquarters of the GMD. During the **reunification campaigns**, an estimated 28 000 people were executed as it was purged of Nationalist forces.
#### Antis campaigns
The [**Three-Anti Campaign**](https://en.wikipedia.org/wiki/Three-anti_and_Five-anti_Campaigns) in 1951 denounced waste, corruption, and bureaucratic inefficiency. Its targets were CCP members, former GMD members, and bureaucratic officials not in the party. Confessions were required for the people denounced in public trials. An estimated 5% of government officials were purged.
!!! example
One thousand officers were denounced in the first month — some for minor offenses like the use of an American car and some more serious such as the use of government money to purchase luxury furniture in offices.
The **Five-Anti Campaign** in 1952 denounced bribery, theft of state property, tax evasion, state property theft, chating on government contracts, and stealing economic intelligence. Its targets were the bourgeoisie, merchants, industrialists, and the rest of the capitalist class. The campaign sent a wave of fear in the bourgoisie, not helped by the Chinese encouraged to support the campaign and denounce people they suspected to be guilty. Those convicted also had to confess their crimes in public trials, and an estimated 450 000 private businesses were convicted.
The results of the campaigns were large-scale purges in the CCP and bourgeoisie, the ceoncept of class struggle devevloped in China, and it showed the population that it challenging the regime would be futile.
### Charisma and propaganda
Mao was seen as the figurehead of China and his image was proimently on display throughout China. His Little Red Book was distributed everywhere, and his charisma was a form of control over the population via his **cult of personality**. There was no distinction between Mao the person, the government, and China in the people's eyes. He received little backlash after the events of the Great Leap Forward and most of the population genuinely mourned his death.
!!! example "Example: "Long Live the Chinese Communist Party that Chairman Mao Personally Founded", April 1973"
<img src="/resources/images/mao-propaganda.jpeg" width=500>(Source: Kognity)</img>
**Propaganda** was under the control of the CCP's Central Propaganda Department up to the Cultural Revolution. Its aims were to spread Chinese ideology and the idea of Maoism against capitalism, indoctrinate the Chinese population, and reinforcce political messages to enhance Mao's cult of personality.
!!! example
The **Combat Illiteracy Campaign** from 1950 to 1956 sent simple reading material all over China including remote places to increase literacy while spreading ideology and propaganda.
From the 1940s to the 1950s, propaganda was generally colourfully visual because not many could read or write and it was cheaper and quicker to produce. Posters portrayed Mao as a god-like figure and all-powerful, symbolised as the father of the nation. They were put up everywhere in publicc spaces, poor citizens used them to decorate their homes, and Mao's picture was always in newspapers, stamps, and pins.
After 1949, radios and loudspeakers were also extensively used, broadcasting government propaganda and national anthems constantly.
**Role models** of real or fictitious people were used in propaganda to teach the population how to behave.
!!! example
Lei Fang was a fictitious soldier who died at 22 and was depicted as a happy and positive person despite experiencing a difficult childhood because his immediate family died at an early age. Mao's propaganda minister, Lin Biao, promoted his image by pushing his diary with positive comments about Mao. In 1953, Mao encouraged everyone to learn the "Lei Feng spirit", and the "Learn from Lei Feng" campaign launched during the Cultural Revolution aimed at getting people to obey and be loyal to Mao.
#### Thought Reform Movement
At the same time of the Antis campaigns, the [**Thought Reform Movement**](https://en.wikipedia.org/wiki/Thought_reform_in_China) from 1951 to 1952 was aimed to get the citizens to accept Marxism-Leninism and Maoism. Teachers and college staff were ordered to become Marxist-Leninists, and intellectuals who studied abroad were forced to confess as "implementers of the imperialist cultural invasion". School curricula were restructured, and propaganda and indoctrination were heavily used to change the citizens.
#### Cult of personality
Mao's cult of personality reached its peak during the Cultural Revolution. The people were drawn in by his promises after a decade of wars and corruption after the fall of the Qing dynasty. As the son of a poor peasant who worked hard to improve his social status, he maintained his image of being connected to the land and the peasants.
!!! example
As a publicity stunt, at the age of 72 years, he swam through the Yangtze River in July 1966 to prove that he was fit to rule. Propaganda at the time claimed he swam nearly 15 kilometres in just over an hour.
#### Education
To create citizens supportive of the state, the CCP controlled the curriculum, reading material, and other information that students were exposed to. Schools effectively became indoctrination centres.
!!! example
- Chinese textbooks were censored.
- The Little Red Book was the primary literary text.
- Elementary education focused on rote (memorisation via repetition) over critical thinking.
- Secondary education focused on testing, exams, physical education, and in practice it was mostly children of high ranking party members and government officials who attended.
**Language reforms** resulted in a new form of Mandarin that allowed for people averywhere in the country to communicate. This standardisation made Mandarin easier to learn but caused local languages to disappear.
The **Socialist Education Movement** from 1964 to 1966 had the goal to cleanse politics, the economy, organisation, and ideology as the "Four Cleanups". Intellectuals were sent to the countryside to be re-educated by peasants. They still attended school, but also worked in factories and with the peasants.
#### Propaganda in the Cultural Revolution
During the Cultural Revolution, it was required that a portrait or sculpture of Mao was present in each home.
Mao called for class struggle in all educational institutions, and education as an ideal was condemned. Peasants and industrial workers were made teachers and pupils, and they were encouraged to criticise their teachers, who were forced to wear dunce caps and were paraded around. Schools and universities closed down and were made into barracks for Red Guards.
!!! info
130 million young people stopped attending school.
The [**Down to the Countryside Movement**](https://en.wikipedia.org/wiki/Down_to_the_Countryside_Movement) beginning in 1968 when the Red Guard was becoming violent and difficult to control had Mao order them to return to schools, with more violent radical groups being forcibly suppressed by the PLA. Urban students were sent to the countryside to experience peasant life. This ripped millions of families apart and many did not go back to school or university when they were allowed to return home.
!!! info
From 1968 to 1976, 17 million young people were sent to rural areas.
#### Arts
Mao's wife, [Jiang Qing](https://en.wikipedia.org/wiki/Jiang_Qing) (Chinese: 江青) was made the chief of new Chinese culture and the "cultural purifier". She imposed censorship on anything that did not meet the criteria of "revolutionary purity".
**Statues** of Mao were erected in front of state offices, universities, and schools.
Traditional Chinese **operas** were replaced by those focused on the proletariat overthrowing class enemies. The more famous ones have political overtones with communist and/or revolutionary themes.
Folk **music** was made modern and an attempt was made to put traditional Chinese music on equal footing. Rousing songs that appealed to the masses were composed, and Western music was entirely banned — symphonic and classical music fell in this category as they were associated with elitism and the West. Mao's poems were put into choral and classical music — the Red Guard sang lyrics derived from the Little Red Book.
**"The East is Red"** was a revolutionary song that was the *de facto* national anthem during the Cultural Revolution. It was played through loudspeakers everywhere at dawn and dusk, sung by students at the beginning of the first class of each day, and shows began with this song.
!!! quote ""The East is Red""
The east is red, the sun is rising,
China has brought forth a Mao Zedong.
He works for the people's welfare.
Hurrah, he is the people's great saviour.
Chairman Mao loves the people,
He is our guide,
To build a new China,
Hurrah, he leads us forward!
The Communist Party is like the sun
Wherever it shines, it is bright.
Wherever there is a Communist Party,
Hurrah, there the people are liberated!
#### Historians
???+ quote "Yan Yen (poet):"
As a result of the Cultural Revolution, you could say the cultural trademark of my generation is that we had no culture.
???+ quote "Michael Lynch:"
Cultural terrorism — Result of the Cultural Revolution: Cultural wasteland. Artists who resisted the revolution were sent to re-educational labour camps, where they were brutally treated. Pianists and string players were made to scratch at the ground so they would never be able to play well again.
### Nature, extent, and treatment of opposition
Mao never had any direct opposition.
#### Struggle sessions
Struggle sessions were a form of public humiliation where people **self-criticise** to find the mistakes they made and to free themselves from error. It was used in the USSR from the 1920s and by Mao during the Yan'an Rectification Movement in 1941, the Anti-Rightist Campaign, and the Cultural Revolution.
#### Purges
**Landlords** were publicly humiliated after land reform and tried then executed in their villages until there were no more landlords. Red Guards looted and destroyed homes, attacking landlords and local officials.
!!! info
An estimated 2-3 million landlorrds were killed.
After Mao's retreat from the Great Leap Forward, in 1966, he decided to reorganise the party by "eliminating members who had taken a capitalist road". In 1968, Liu Shaoqi and Deng Xiaoping were denounced and stripped of their positions. Liu was struggled against and humiliated while the propaganda campaign accused him of being a traitor. He died in November 1969 in prison. Deng was also struggled against and publicly shamed but put under house arrest with his wife, later sent to Jiangxi for re-education through labour.
#### Laojiao and Laogai
[**Laojiao**](https://en.wikipedia.org/wiki/Re-education_through_labor) (Chinese: 劳教)), or re-education through labour, involved sending prisoners to labour camps. Designed to re-educate intellectuals, the goal was for prisoners to live and work with farmers and workers. They were also required to attend political classes where they denounced themselves and criticised their own thinking to realign their thoughts with communism. Those who committed smaller crimes that did not warrant capital punishment were sent here.
[**Laogai**](https://en.wikipedia.org/wiki/Laogai) (Chinese: 劳改), or reform through labour, is a lake in *Avatar: The Last Airbender*. Located in Ba Sing Se in the Earth Kingdom, it hid an underground prison where those interned were brainwashed. It is also compared to the USSR's [*gulag*](https://en.wikipedia.org/wiki/Gulag). As internment camps for criminals, they were built in areas with extreme wewather and interns were forced to perform hard labour such as digging dithes and building roads under extremely poor conditions.
!!! quote
The Earth King has invited you to Lake Laogai.
### Extent of authoritarian control
As China is still under authoritarian control and many numbers and facts are inaccurate or unknown, it is difficult to obtain concrete information. However, it appears very **totalitarian**.
The Chinese followed **Confucian** philosophy, so social harmony was very important to them. Individuals were expected to accept their position in society and respect authority and the hierarchy. This led to less opposition and greater conformity. Unlike in the West, where the state is viewed as the oppressor, the state was viewed in China as family and the protector of civilisation.
**Maoism** was described as "Marxism adapted to Chinese conditions". It held the following differences compared to Marxism:
1. Peasants are the **agents of change** as opposed to urban workers, and they are moldable via social engineering. Mao used this to set up his own cult that would keep others in line.
3. All revolutions require constant renewal, and permanent, **constant revolution** is required to prevent counter-revolution. Mao related stability to dangerous bureaucracy and privileged classes such as imperial China and the USSR under Khrushchev. He used this to justify constant revolution such as the Hundred Flowers Campaign and Cultural Revolution, creating a culture where violent upheaval was a regular way of life.
### Historians
???+ quote "Liang Heng, age 12, recount of late 1967 after 11 million young people travelled to Beijing for Mao:"
If there was a single thing that meant ecstasy to everyone in those days, it was seeing Chairman Mao. Ever since I had been in Peking, the possibility had been in the back of my mind, and, like every other Red Guard, I would have laid down my life for the chance… On May 1st Peng Ming was planning to go with a small group to conduct performances of Revolutionary songs at the Summer Palace during the day…and I was sometimes asked to carry drums and other instruments, so I went with Peng Mings group to the park. We were completely unprepared for what happened. In the middle of singing a song that Peng Ming had composed himself, we heard the great news: Chairman Mao was in the park! Gathering our instruments together hastily, we ran gasping to the spot, but it was too late. He was gone. All that remained of him was the touch of his hand on the hands of a few who had been lucky enough to get close to him. But we didnt leave in disappointment. That trace of precious warmth in the palms of others seemed to us a more than adequate substitute for the real thing. Those Chairman Mao had touched now became the focus of our fervor. Everyone surged toward them with outstretched arms in hopes of transferring the sacred touch to their own hands. If you couldnt get close enough for that, then shaking the hand of someone who had shaken the hands with Our Great Saving Star would have to do.
## Foreign policy of China
!!! definition
**Sinocentrism** is the idea that China is the cultural, political, and/or economic centre of the world.
Mao was concentrated on maintaining and consolidating his power in China, but he supported the idea of an **international communist revolution** and focused on re-establishing China's position as a great power in the world.
After [Joseph Stalin](https://en.wikipedia.org/wiki/Joseph_Stalin)'s death, Mao was seen by many to be the leader of the communist world.
!!! example
In 1964, China detonated its first nuclear bomb, claiming its necessity for defense and in opposing the "US imperialist policy of nuclear blackmail and nuclear threats". Originally advocating for the abolishment of nuclear weapons but blocked by the US, evidence seems to suggest that Mao was quite willing to use nuclear weapons, believing that China's population would recover quickly.
### Sino-Soviet relations
China's relationship with the USSR started off well enough but steadily deteriorated by the 1960s.
#### Treaty of Friendship, Alliance, and Mutual Assistance
On 16 December 1949, Mao took his first trip abroad to Moscow only a few months after the establishment of the PRC. He was not met with great enthusiasm — Soviet leaders would meet him but would not drink or eat lunch with him, and there were no celebrations upon his arrival. He was in essence treated like a minor politician from a small communist country.
The visit lasted three months and culminated in the signing of the treaty on 14 February 1950. In the [Sino-Soviet Treaty of Friendship, Alliance, and Mutual Assistance](https://en.wikipedia.org/wiki/Sino-Soviet_Treaty_of_Friendship,_Alliance_and_Mutual_Assistance), the USSR:
- recognised the People's Republic of China as the legitimate government of China
- lent $300 million over five years to aid economic and logistic recovery from a decade of warfare
- sent assistance from 11 000+ Soviet consultants and experts to be paid for by the PRC
#### Korean War
!!! background
From 1910 to August 1945, Korea was occupied by imperial Japan. After the end of World War II, the USSR and the US agreed to temporarily divide Korea along the 38th parallel and established a communist government in the north and a democratic government in the south, respectively.
<center><img src="/resources/images/korea-map.png" width=350></img></center>
(Source: Kognity)
Under a desire to unify Korea under communism, North Korean leader [Kim Il-Sung](https://en.wikipedia.org/wiki/Kim_Il-sung) asked Stalin for approval to attack South Korea but was denied due to the [Berlin Blockade](https://en.wikipedia.org/wiki/Berlin_Blockade) at the time. His approval was granted later in April 1950 and the surprise attack launched on 25 June 1950, capturing important cities such as Seoul.
In response, the [United Nations Security Council](https://en.wikipedia.org/wiki/United_Nations_Security_Council) declared North Korea as the aggressor and sent troops from 15 countries led by the US to restore peace under American general [Douglas MacArthur](https://en.wikipedia.org/wiki/Douglas_MacArthur), successfully retaking the 38th parallel.
!!! info
- The UN motion to send troops only succeeded because the Soviet delegate with [veto powers](https://en.wikipedia.org/wiki/United_Nations_Security_Council_veto_power) was absent as a protest against UN refusal to accept the PRC as the legitimate government of China.
- The United States, South Korea, and other nations sent 350 000, 400 000, and 50 000 troops, respectively.
!!! background
- North Korea made significant contributions to the CCP during their liberation of mainland China.
- Sino-American relations during this time period were especially poor due to the Truman administration declaring their support for the Republic of China on Taiwan as the "main China".
When UN forces crossed the Yalu River on the China-Korea border, Mao felt China's security was at stake and also recognised an opportunity to assert power. Additionally, concern over border security with a hostile east due to a revived Japan, a desire to replace the Soviet influence in North Korea with their own, and Stalin pressing Mao to assist in the war led China to intervene.
In October 1950, the [Chinese People's Volunteers](https://en.wikipedia.org/wiki/People%27s_Volunteer_Army) — in actuality a group of forces from the main People's Liberation Army under a different name to avoid official war with the US — deployed 500 000 troops push the UN troops back to the 38th parallel, resulting in a stalemate back at status quo by 1951. Talks lasted two years with US President [Eisenhower](https://en.wikipedia.org/wiki/Dwight_D._Eisenhower) threatening the use of nuclear weapons should they drag on until an [**armistice**](https://en.wikipedia.org/wiki/Korean_Armistice_Agreement) was signed on 27 July 1953.
???+ info
**Casualties in the Korean War**
<img src="/resources/images/korean-war-casualties.png" width=500>(Source: Kognity)</img>
From China's perspective, the war was both a success and a failure. Mao propagandised the war as a total success in their aim to "Resist America and Defend Korea".
| Success | Failure |
| --- | --- |
| Mao gained considerable prestige for being able to fight the US to a standstill | Heavy casualties — Mao's eldest son was killed in an air raid |
| North Korea remained communist | Sino-American relations deteriorated further, and China faced a total embargo from the US |
| China preserved its Manchurian border where its heavy industry was concentrated | The USSR-lent military equipment had to be repaid |
#### Sino-Soviet split
Stalin and Mao's relationship was tense, and the relationship between the two countries deteriorated much faster under [Nikita Khrushchev](https://en.wikipedia.org/wiki/Nikita_Khrushchev).
!!! background
The border between the Soviet Union and China was determined by many treaties signed by various officials over many years. This left many gray areas where both countries claimed soverignity.
**Border conflicts** in 1969 between the two countries led to seven months of unofficial conflicts and border clashes over various islands and rivers. At this point in time, both countries had nuclear weapons. Tensions persisted until September 1969 when the Chinese Premier and Soviet Minister of Foreign Affairs met in Beijing in September 1969.
**Personality and ideological conflicts** between the leaders and countries worsened relations. Mao acted like an obedient student and never openly contradicted Stalin while he was in power but was often annoyed by his level of control over the CCP. Stalin was annoyed by Mao's attitude but needed a strong ally.
!!! example
- In 1921, Mao believed that the rural population would lead China to revolution while Stalin interpreted that the proletariat could only be urban workers.
- After the end of World War II, Stalin requested Mao to work with the GMD, but Mao decided to wipe out the party and take power instead.
In 1956, after Stalin's death, Khrushchev gave a [secret speech](https://en.wikipedia.org/wiki/On_the_Cult_of_Personality_and_Its_Consequences) denouncing his rule. Mao was alarmed by the brutality of these attacks and interpreted the speech as criticism against him and his own leadership in China.
!!! definition
- **Détente** between the US and Soviet Union was the relaxation of strained relations between the two countries.
- **Revisionism** in this context is the betrayal of original revolutionary ideas.
- **Peaceful coexistence** is the belief that both capitalist and communist nations can exist together without war.
In 1957, Khrushchev organised a [conference in Moscow](https://en.wikipedia.org/wiki/1957_International_Meeting_of_Communist_and_Workers_Parties), inviting all communist states including China. Mao complained about Khrushchev's [revisionism](https://en.wikipedia.org/wiki/Revisionism_(Marxism)) and [peaceful coexistence](https://en.wikipedia.org/wiki/Peaceful_coexistence)/[detente](https://en.wikipedia.org/wiki/D%C3%A9tente) approaches with the United States. Mao believed that it was the duty of communists to conduct class warfare and that the Soviet Union was being too soft on the West by making concessions — they were not fit to lead the communist world. He thought that a final violent conflict was needed with capitalism.
In 1958, Khrushchev was invited to visit China and Mao treated him with disdain, aiming to make his visit unpleasant: the Soviet delegation was placed in a hotel with no AC, Mao invited Khrushchev to swim in his private pool — aware of his inability to swim, and refused any proposals for military cooperation and defense initiatives. In response, Khrushchev pulled most advisors out from China and removed all of them by 1960.
**Chinese meddling in Soviet international affairs** resulted in open defiance against the USSR. Unimpressed with de-Stalinisation, when Albania left the USSR in 1961, China supported them against the Soviet Union, pouring money into the country. In return, Albanian leader Enver Hoxha declared his support for Mao.
Further examples of disagreements during the Sino-Soviet split include:
- 1958: Mao wanted the USSR to use their first satellite, Sputnik-1, to aid revolutionary efforts, but Khrushchev refused to risk nuclear conflict.
- 1959: [China invaded Tibet](https://en.wikipedia.org/wiki/Annexation_of_Tibet_by_the_People's_Republic_of_China), but the USSR refused support and withdrew its support from the Chinese nuclear program by refusing to give them a prototype weapon.
- 1962: China disagreed with the USSR in backing down and making in a deal in the [Cuban Missile Crisis](https://en.wikipedia.org/wiki/Cuban_Missile_Crisis), wanting them to support third world countries in their fight against communism.
- 1963: China opposed the USSR signing of the [Partial Nuclear Test Ban Treaty](https://en.wikipedia.org/wiki/Partial_Nuclear_Test_Ban_Treaty) against nuclear weapons, sparking a fierce propaganda war.
### Cross-Strait relations
Mao never recognised Taiwan as an independent state.
In the [First Taiwan Strait Crisis](https://en.wikipedia.org/wiki/First_Taiwan_Strait_Crisis) from 1954 to 1955, the PLA bombed various islands near Taiwan and then seized the [Yijiangshan Islands](https://en.wikipedia.org/wiki/Yijiangshan_Islands) in a military conflict. This led to the [Formosa Resolution](https://en.wikipedia.org/wiki/Formosa_Resolution_of_1955) to be enacted by the US Congress — that US forces would defend Taiwan against any attack from the mainland.
In 1958, Mao ordered the PLA to attack the Taiwan-surrounding and -controlled islands of Kinmen and Matsu without discussion with the USSR. As the US prepared for war because of the Formosa Resolution, Mao stood down because he did not have USSR backup. In the aftermath, Khrushchev accused Mao of being a [Trotskyist](https://en.wikipedia.org/wiki/Trotskyism) who had lost all sense of reality.
### Sino-American relations
The US viewed China as an aggressive country with the objective of threatening the security of the non-communist states surrounding it. China viewed the US as their enemy.
!!! example
The [Red Scares](https://en.wikipedia.org/wiki/Red_Scare) in the US and the anti-American and anti-capitalist propaganda in China (e.g., "Death to the American imperialists") meant that the two countries could not easily communicate diplomatically in public.
To "contain" communism in China, the US signed several treaties such as the [Southeast Asia Treaty Organization](https://en.wikipedia.org/wiki/Southeast_Asia_Treaty_Organization) and the [ANZUS Treaty](https://en.wikipedia.org/wiki/ANZUS) to ward off China. Additionally, they gave the Chinese seat at the UN to Taiwan, pushed allies to avoid entertaining diplomatic relations with Taiwan, supported countries that felt threatened by China, encouraged the split between the USSR and China, and implemented a trade embargo.
From 1970 onward, the two countries began to grow closer — China wanted a new strong ally as Sino-Soviet relations were deteriorating and the US wanted a way out of the Vietnam War.
Taking advantage of [ping-pong diplomacy](https://en.wikipedia.org/wiki/Ping-pong_diplomacy), the exchange of ping-pong players between the US and China, US Secretary of State Henry Kissinger went secretly to meet Chinese Premier Zhou Enlai.
The [**Shanghai Communiqué**](https://en.wikipedia.org/wiki/Shanghai_Communiqu%C3%A9) signed between the two countries on 28 February 1972 was a statement issued by both countries during US President Richard Nixon's visit to China — the first visit to the PRC by any US President — and began the normalisation of relations between them. Nixon described the visit as a mission for peace with the goal to re-establish communications after a generation of hostility, and agreements were reached to expand cultural, educational, and journalistic contracts.
### Historians
???+ quote "*Mao: a Biography* - Ross Terill (revisionist and somewhat sympathetic to Mao), 1995:"
Mao knew little of the world outside China, and nothing of the capitalist world… Yet Mao took a lively interest in the world beyond the Soviet Bloc during the early 1960s… It was as if the split with Russia in 1960 took a burden off the back of Chinese diplomacy. Instead of being junior partner in someone elses show, Mao made China its own one-man show on the broadening stage of the Third World.
???+ quote "*Mao: Profiles in Power* - Shaun Breslin, 1998:"
Maos main objective in all of his foreign policy initiative from 1949 to 1976 was to safeguard Chinas borders and restore China to its rightful position on the world stage. Mao had a traditional Sinocentrism: the notion that China is the central place in the world, and that only those who recognise and accept Chinese superiority can be considered to be civilised.
???+ quote "*Mao Zedong* - Maurice Meisner (sympathetic to socialist ideology and goals), 2007:"
Maos foreign policy clothed itself in revolutionary rhetoric, but was conservatively cautious in substance, based on narrow calculation of Chinas national self-interest… In Maos view the Soviet Union posed a greater danger to China than did the United States.
## Resources
- [IB History Syllabus](/resources/g11/ib-history-syllabus.pdf)
- [Textbook: Origins and Development of Authoritarian and Single-Party States](/resources/g11/textbook-authoritarian-states.pdf)
- [Textbook: Causes and Effects of 20th-Century Wars, Second Edition ](/resources/g11/textbook-cause-20-century-wars.pdf)
- [Textbook: The Move to Global War](/resources/g11/textbook-move-global-war.pdf)

View File

@ -1,9 +0,0 @@
# SL French - 1
The course code for this page is **FSF3U7**.
Ahaha good luck with this I'm outta here
## Resources
- [Textbook: Oxford IB French B Course Companion](/resources/g11/textbook-french-b-second-edition.pdf) ([Answers](/resources/g11/textbook-french-b-second-edition-answers.pdf))

View File

@ -1,749 +0,0 @@
# SL Math - Analysis and Approaches - 2
The course code for this page is **MCV4U7**.
## Integration
Integration is an operation that finds the **net** area under a curve, and is the opposite operation of differentiation. As such, it is also known as **anti-differentiation**.
The area under a curve between the interval of x-values $[a,b]$ is:
$$A=\lim_{x\to\infty}\sum^n_{i=1}f(x_i)\Delta x$$
which can be simplified to, where $dx$ indicates that integration should be performed with respect to $x$:
$$A=\int^b_a f(x)dx$$
While $\Sigma$ refers to a finite sum, $\int$ refers to the sum of a limit.
As integration is the opposite operation of differentiation, they can cancel each other out.
$$\frac{d}{dx}\int f(x)dx=f(x)$$
The **integral** or **anti-derivative** of a function is capitalised by convention. Where $C$ is an unknown constant:
$$\int f(x)dx=F(x)+C$$
When integrating, there is always an unknown constant $C$ as there are infinitely many possible functions that have the same rate of change but have different vertical translations.
!!! definition
- $C$ is known as the **constant of integration**.
- $f(x)$ is the **integrand**.
### Integration rules
$$
\begin{align*}
&\int 1dx &= &&x+C \\
&\int (ax^n)dx, n≠-1 &=&&\frac{a}{n+1}x^{n+1} + C \\
&\int (x^{-1})dx&=&&\ln|x|+C \\
&\int (ax+b)^{-1}dx&=&&\frac{\ln|ax+b|}{a}+C \\
&\int (ae^{kx})dx &= &&\frac{a}{k}e^{kx} + C \\
&\int (\sin kx)dx &= &&\frac{-\cos kx}{k}+C \\
&\int (\cos kx)dx &= &&\frac{\sin kx}{k}+C \\
\end{align*}
$$
Similar to differentiation, integration allows for constant multiples to be brought out and terms to be considered individually.
$$
\begin{align*}
&\int k\cdot f(x)dx&=&&k\int f(x)dx \\
&\int[f(x)\pm g(x)]dx&=&&\int f(x)dx \pm \int g(x)dx
\end{align*}
$$
### Indefinite integration
The indefinite integral of a function contains every possible anti-derivative — that is, it contains the constant of integration $C$.
$$\int f(x)dx=F(x)+C$$
### Substitution rule
Similar to limit evaluation, the substitution of complex expressions involving $x$ and $dx$ with $u$ and $du$ is generally used to work with the chain rule.
$$
u=g(x) \\
\int f(g(x))\cdot g´(x)\cdot dx = \int f(u)\cdot du
$$
??? example
To solve $\int (x\sqrt{x-1})dx$:
$$
let\ u=x-1 \\
∴ \frac{du}{dx}=1 \\
∴ du=dx \\
\begin{align*}
\int (x\sqrt{x-1})dx &\to \int(u+1)(u^\frac{1}{2})du \\
&= \int(u^\frac{3}{2}+u^\frac{1}{2})du \\
&= \frac{2}{5}u^\frac{5}{2}+\frac{2}{3}u^\frac{3}{2}+C \\
&= \frac{2}{5}(x-1)^\frac{5}{2} + \frac{2}{3}(x-1)^\frac{3}{2} + C
\end{align*}
$$
### Definite integration
To find a numerical value of the area under the curve in the bounded interval $[a,b]$, the **definite** integral can be taken.
$$\int^b_a f(x)dx$$
$a$ and $b$ are known as the lower and upper **limits of integration**, respectively.
<img src="/resources/images/integration.png" width=700>(Source; Kognity)</img>
Regions **under** the x-axis are treated as negative while those above are positive, cancelling each other out, so the definite integral finds something like the net area over an interval.
If $f(x)$ is continuous at $[a,b]$ and $F(x)$ is the anti-derivative, the definite integral is equal to:
$$\int^b_a f(x)dx=F(x)\biggr]^b_a=F(b)-F(a)$$
As such, it can be evaluated manually by integrating the function and subtracting the two anti-derivatives.
!!! warning
If $u$-substitution is used, the limits of integration must be adjusted accordingly.
To find the total **area** enclosed between the x-axis, $x=a$, $x=b$, and $f(x)$, the function needs to be split at each x-intercept and the absolute value of each definite integral in those intervals summed.
$$A=\int^b_a \big|f(x)\big| dx$$
### Properties of definite integration
The following rules only apply while $f(x)$ and $g(x)$ are continuous in the interval $[a,b]$ and $c$ is a constant.
$$
\begin{align*}
&\int^a_a f(x)dx&=&&0 \\
&\int^b_a c\cdot dx&=&&c(b-a) \\
&\int^a_b f(x)dx&=&&-\int^b_a f(x)dx \\
&\int^c_a f(x)dx&=&&\int^b_a f(x)dx + \int^c_b f(x)dx
\end{align*}
$$
The **constant multiple** and **sum** rules still apply.
### Area between two curves
To find the area enclosed between two curves, the graph should be sketched if possible and their points of intersection determined to identify which parts of each function are on top of the other at any given time. An interval chart may be helpful. For each section, where $f(x)$ is always greater than $g(x)$ in the interval $[a,b]$:
$$A=\int^b_a [f(x)-g(x)]dx, f(x)\geq g(x)\text{ in } [a,b]$$
If the limits of integration are not given, they are the outermost points of intersection of the two curves.
### Volumes of solids of revolution
Shapes formed by rotating a line or curve about a fixed axis, such as cones, spheres, and cylinders are all known as **solids of revolution**. By splicing each shape into infinitely small disks, the cylinder volume formula can be used to find the volume of the solid.
$$
\begin{align*}
V&=\lim_{x\to 0}\sum^b_{x=a}\pi y^2 dx \\
&=\pi\int^b_a y^2 dx
\end{align*}
$$
The area between two curves can also be rotated to form a solid, in which case its formula is:
$$V=\pi\int^b_a \big[g(x)^2-f(x)^2\big]dx, g(x)>f(x)$$
## Probability
!!! definition
- $\cap$ is the **intersection sign** and means "and".
- $\cup$ is the **union sign** and means "or".
- $\subset$ is the **subset sign** and indicates that the value on the left is a subset of the value on the right.
- The **sample space** of an experiment is a list/set of all of the possible outcomes.
- An **event** is a subset of a sample space that contains outcomes that meet a particular requirement.
### Sets
A **set** is a collection of things represented with curly brackets that can be assigned to a variable.
!!! example
$A=\{0,1,2\}$ assigns the variable $A$ to a collection of numbers $0, 1, 2$.
The variable $U$ is usually reserved for the **universal set**: a set that contains all of the elements under discussion for a particular situation.
Where both $A$ and $B$ are sets:
- $A\cap B$ returns a new set with only objects that belong to both $A$ **and** $B$.
- $A\cup B$ returns a new set with only objects that are inclusively in either $A$ **or** $B$.
- $A\subset B$ is true only if all of the elements in $A$ are also in $B$.
- $A'$ or $A^c$ return the **complement** of a set: they return all elements in the universal set that are **not** in $A$.
- $n(A)$ returns the number of elements in set $A$.
An empty/**null** set contains no objects and is represented either as $\{\}$ or $\emptyset$.
Two sets are **disjoint** or **distinct** if they have no common elements between them.
!!! warning
Generally, unless specified otherwise, "between" should be inferred to mean "inclusively between".
### Probability rules
The probability of an event is represented by $P(A)$, where $A$ is the event.
$$P(A)=\frac{n(A)}{n(U)}$$
As event $A$ must be a subset of all possible outcomes $U$, where $1$ indicates that the event always happens and $0$ the opposite:
$$0\leq P(A)\leq 1$$
The **complement** of event $A$ is the probability that it does not happen. It is written as $A^c$, $A'$, or $\pu{not } A$.
$$P(A')=1-P(A)$$
Events $A$ and $B$ are **disjoint** or mutually exclusive if no outcomes between them are common and can never happen simultaneously. As such the probability of one of the events happening is equal to their sum.
$$
P(A\cup B)=P(A)+P(B) \\
P(A\cap B)=0
$$
Events $A$ and $B$ are **exhaustive** if their union includes all possible outcomes in the sample space: $A\cup B=U$.
$$P(A\cup B)=1$$
The **principle of inclusion and exclusion** forms a general rule for the union between two *independent* events:
$$P(A\cup B)=P(A)+P(B)-P(A\cap B)$$
For independent events:
$$P(A\cap B)=P(A)\times P(B)$$
### Conditional probability
A vertical bar is used between two events to denote that the event on the left occurs knowing that the right has already occurred.
$$P(A|B) = \frac{P(A\cap B)}{P(B)}$$
!!! example
$P(A|B)$ is the probability of event $A$ given $B$ has occurred.
### Probability distributions and discrete random variables
The **discrete random variable**, $X$, represents a **quantifiable**, measurable, discrete quantity. The lowercase $x$ represents a possible value of $X$.
The probability that $X$ takes on any one of the specific possible outcomes is written as $P(X=x)$. The sum of the probability all possible outcomes must still remain $1$:
$$\Sigma P(X=x)=1$$
!!! example
In an experiment of tossing a coin twice, possible values of $X$ include $0,1,2$ so $x\in\{0, 1, 2\}$.
A **probability distribution** is a distribution of outcomes and their probabilities. Events/outcomes are placed on the top row while probability is provided on the bottom in the form of a fraction. Probability distributions can also be graphed with the outcomes on the x-axis and their probabilities on the y-axis with lines similar to a bar graph sitting on the grid lines to represent a probability..
!!! example
For the coin ross experiment in the previous example, where $X$ is the number of tails when tossing a coin twice:
| $x$ | $0$ | $1$ | $2$ |
| --- | --- | --- | --- |
| $P(X=x)$ | $\frac{1}{4}$ | $\frac{1}{2}$ | $\frac{1}{4}$ |
The **expected value** of an experiment or the "expectation of $X$" is the mean value of $X$ that is expected to be obtained over many trials. It is equal to the sum of the value of all outcomes multiplied by their probability.
$$
\begin{align*}
E(X)&=\Sigma P(X=x)x \\
&=\mu=x_1p_1+x_2p_2+...+x_kp_k
\end{align*}
$$
!!! warning
It is possible that the expected value will not be a value in the set, and the expected value should **not be mistaken** with the outcome with the highest probability.
### Binomial distribution
**Bernoulli trials** have a fixed number of trials that are independent of each other and identical with only two possible outcomes — a success or failure.
Where $r$ is the number of successes in a Bernoulli trial:
$$P(X=r)={n\choose r}p^rq^{n-r}$$
where ${n\choose r}=\frac{n!}{r!(n-r)!}$
A binomial distribution is a probability distribution of two possible events, a success or a failure. The distribution is defined by the number of trials, $n$, and the probability of a success, $p$. The probability of failure is defined as $q=1-p$.
$X\sim$ denotes that the random variable $X$ is distributed in a certain way. Therefore, the binomial distribution of $X$ is expressed as:
$$X\sim B(n, p)$$
In a binomial distribution, the expected value and **variance** are as follows:
$$
E(X)=np \\
Var(X)=npq
$$
On a graphing display calculator, where $r$ is the number of successes:
$$
\begin{align*}
P(X=r)&=\text{binompdf}(n,p,r) \\
P(X<r)&=\text{binomcdf}(n,p,r-1) \\
P(X\leq r)&=\text{binomcdf}(n,p,r) \\
P(a\leq X\leq b)&=\text{binomcdf}(n,p,b) - \text{binomcdf}(n,p,a-1)
\end{align*}
$$
### Normal distribution
Also known as **Gaussian distribution** or in its graphical form, a normal or bell curve, the normal distribution is a **continuous** probability distribution for the random variable $x$.
<img src="/resources/images/gaussian-distribution.png" width=700>(Source: Kognity)</img>
In a normal distribution:
- The mean, median, and mode are all equal.
- The normal curve is bell-shaped and symmetric about the mean.
- The area under the curve is equal to one.
- The normal curve approaches but does not touch the x-axis as it approaches $\pm \infty$.
From $\mu-\sigma$ to $\mu+\sigma$, the curve curves downward. $\mu\pm\sigma$ are the **inflection points** of the graph. It is expressed graphically as:
$$X\sim N(\mu,\sigma^2)$$
where
$$f(x)=\frac{1}{\sigma\sqrt{2\pi}}e^\frac{-(x-\mu)^2}{2\sigma^2}$$
~68%, ~95%, and ~99.7% of the data is found within one, two, and three standard deviations of the mean, respectively.
### Standard normal distribution
The **standard normal distribution** has a mean of 0 and standard deviation of 1. The horizontal scale of the standard normal curve corresponds to **$z$-scores** that represent the number of standard deviations away from the mean. To convert an $x$-score to a $z$-score:
$$z=\frac{x-\mu}{\sigma}$$
A **Standard Normal Table** can be used to determine the cumulative area under the standard normal curve to the left of scores -3.49 to 3.49. The area to the *right* of the score is equal to $1-z_\text{left}$. The area *between* two z-scores is the difference in between the area of the two z-scores.
To standardise a normal random variable, it should be converted from the form $X\sim N(\mu,\sigma^2)$ to $Z\sim N(0,1)$ via the formula to convert between x- and z-scores.
The probability of a z-score being less than a value can be rewritten as phi.
$$P(z<a)=\phi(a)$$
Some z-score rules partially taken from probability rules:
$$
\begin{align*}
P(z>-a)&=P(z<a) \\
1-P(z>a)&=P(z<a)
\end{align*}
$$
On a graphing display calculator:
The `normalcdf` command can be used to find the cumulative probabilty in a normal distribution in the format $\text{normalcdf}(a,b,\mu,\sigma)$, which will solve for $P(a<x<b)$. $-1000$ is generally a sufficiently low value to solve for just $P(x<b)$.
## Vectors
Please see [SL Physics 1#1.3 - Vectors and Scalars](/sph3u7/#13-vectors-and-scalars) for more information.
One vector can be represented in a variety of methods. The algebraic form $(1, 2)$ can also be represented in the alternate algebraic forms $[1, 2]$ and $1\choose 2$.
Where $v$ is the vector, $A$ is the initial and $B$ is the terminal point of the vector, a vector can be identified by any of the following symbols:
- $\vec{AB}$
- $\vec{v}$
- $\boldsymbol{v}$ (bolded)
The special **zero vector** $\vec{0}$ is a vector of undefined direction and zero magnitude.
Vectors with the same magnitude but opposite directions are equal to one another except one is the negative of the other.
**Colinear** vectors are those that parallel with one another — that is, with identical or opposite directions. Vectors that are colinear must also be **scalar multiples** of each other:
$$\vec{u}=k\vec{v}$$
**Position** vectors are vectors where the initial point is at the origin — where the terminal point is $A$, a position vector can be written as $\vec{OA}$.
**Colinear points** are points that lie on the same straight line. If two colinear vectors that share a common point can be formed between three points, those points are colinear.
### Unit vector
The **unit vector** of a vector is a vector of the same direction as the original with a magnitude of $1$. It is denoted via a caret/hat.
$$\hat{v}$$
From the original vector $\vec{u}$, the unit vector $\hat{u}$ can be found by dividing by the magnitude of the vector.
$$\hat{u}=\frac{\vec{u}}{|\vec{u}|}$$
The **standard unit vectors** $\hat{i}$ and $\hat{j}$ are unit vectors designated to point in the directions of the positive x- and y-axes.
$$
\hat{i}=(1,0) \\
\hat{j}=(0,1)
$$
Any vector in two dimensions can be expressed as a sum of scalar multiples of the vectors.
$$
\begin{align*}
\vec{u}&=\vec{OP} \\
&=(a,b) \\
&=a\hat{i}+b\hat{j} \\
&={a\choose b} \\
|\vec{u}|&=\sqrt{a^2+b^2}
\end{align*}
$$
The angle between two vectors is the smaller angle formed when the vectors are placed **tail to tail**.
### Three-dimensional vectors
The additional standard unit vector $\hat{k}$ is used for the z-dimension.
$$
\begin{align*}
\vec{u}&=\vec{OP} \\
&=(a,b,c) \\
&=a\hat{i}+b\hat{j}+c\hat{k}
\end{align*}
$$
In general, the x-plane is the one in and out of the page, the y-plane left and right, and the z-plane up and down.
### Vector operations
Please see [SL Physics 1#Adding/subtracting vectors diagrammatically](/sph3u7/#addingsubtracting-vectors-diagrammatically) for more details. The sum of two vectors is known as the **resultant** while the negative (opposite direction) version of that vector is known as the **equilibrant**.
The sum of two vectors can also be solved diagrammatically by envisioning the head-to-tail as a parallelogram.
<img src="/resources/images/vector-parallelogram.png" width=700>(Source: Kognity)</img>
### Dot product
Also known as the scalar product, the dot product between two vectors returns a **scalar** value representing the horizontal displacement after multiplication. Wheree $\theta$ is the angle contained between the vectors $\vec{u}$ and $\vec{v}$ when arranged tail-to-tail:
$$\vec{u}\bullet\vec{v}=|\vec{u}||\vec{v}|\cos\theta$$
!!! note
This implies that vectors perpendicular to one another must have a dot product of zero.
Much like regular multiplication, dot products are:
- communtative: $\vec{u}\bullet\vec{v}=\vec{v}\bullet\vec{u}$
- distributive over vectors: $\vec{u}\bullet(\vec{v}+\vec{w})=\vec{u}\bullet\vec{v}+\vec{u}\bullet\vec{w}$
- associative over scalars: $(m\vec{u})\bullet(n\vec{v})=mn(\vec{u}\bullet\vec{v})$
- $m(\vec{u}\bullet\vec{v})=(m\vec{u})\bullet\vec{v}=(mv)\bullet\vec{u}$
When working with algebraic vectors, their dot products are equal to the products of their components.
$$\vec{u}\bullet\vec{v}=u_xv_x+u_yv_y$$
### Vector line equations in two dimensions
!!! definition
The **Cartesian** or **scalar** form of a line is of the form $Ax+By+C$.
The vector equation for a straight line solves for an unknown position vector $\vec{r}$ on the line using a known position vector $\vec{r_0}$ on the line, a direction vector parallel to the line $\vec{m}$, and the variable **parameter** $t$. It is roughly similar to $y=b+xm$.
$$\vec{r}=\vec{r_0}+t\vec{m},t\in\mathbb{R}$$
The equation can be rewritten in the algebraic form to be
$$[x,y]=[x_0,y_0]+t[m_1,m_2], t\in\mathbb{R}$$
The direction vector is effectively the slope of a line.
$$\vec{m}=[\Delta x, \Delta y]$$
For a line in scalar form:
$$\vec{m}=[B, -A]$$
To determine if a point lies along a line defined by a vector equation, the parameter $t$ should be checked to be the same for the $x$ and $y$ coordinates of the point.
!!! warning
Vector equations are **not unique** — there can be different position vectors and direction vectors that return the same line.
The **parametric** form of a line breaks the vector form into components.
$$
\begin{align*}
x&=x_0+tm_1 \\
y&=y_0+tm_2,t\in\mathbb{R}
\end{align*}
$$
The **symmetric** form of the equation takes the parametric form and equates the two equations to each other using $t$.
$$\frac{x-x_0}{m_1}=\frac{y-y_0}{m_2},m_1,m_2\neq 0$$
If one of the **direction numbers** $m_1$ or $m_2$ is zero, the equation is rearranged such that only one position component is on one side.
!!! example
Where $m_2=0$:
$$\frac{x-x_0}{m_1},y=y_0$$
### Vector line equations in three dimensions
There is little difference between vector equations in two or three dimensions. An additional variable is added for the third dimension.
The vector form:
$$\vec{r}=\vec{r_0}+t\vec{m},t\in\mathbb{R}$$
The parametric form:
$$[x,y,z]=[x_0,y_0,z_0]+t[m_1,m_2,m_3],t\in\mathbb{R}$$
The symmetric form:
$$\frac{x-x_0}{m_1}=\frac{y-y_0}{m_2}=\frac{z-z_0}{m_3}$$
### Intersections of vector equation lines
Two lines are parallel if their direction vectors are scalar multiples of each other.
$$\vec{m_1}=k\vec{m_2},k\in\mathbb{R}$$
Two lines are coincident if they are parallel and share at least one point. Otherwise, they are distinct.
If two lines are not parallel and in two dimensions, they intersect. To solve for the point of intersection, the x and y variables in the parametric form can be equated and the parameter $t$ solved.
In three dimensions, there is a final possibility should the lines not be parallel: the lines may be *skew*. To determine if the lines are skew, the x, y, and z variables of **two** parametric equations should be equated to their counterparts in the other vector as if they intersect. The resulting $t$ and $s$ from the first and second line respectively should be substituted into the third equation and an equality check performed. Should there not be a solution that fulfills the third equation, the lines are skew. Otherwise, they intersect.
### Vector projections
If two vectors $\vec{a}$ and $\vec{b}$ are placed tail-to-tail, the **component** of $\vec{a}$ in the direction of $\vec{b}$ is known as the **vector projection of $\vec{a}$ onto $\vec{b}$**. Represented by $Projection$, its magnitude is called the **scalar projection**.
$$Proj_\vec{b}\vec{a}=\biggr(\frac{\vec{a}\bullet\vec{b}}{|\vec{b}|^2}\biggr)\vec{b}$$
$$
\begin{align*}
|Proj_\vec{b}\vec{a}|&=\frac{\vec{a}\bullet\vec{b}}{|\vec{b}|} \\
&=|\vec{a}|\cos\theta
\end{align*}
$$
!!! warning
The magnitude of any projection is always **positive**. If $\cos\theta$ returns a negative value, it needs to be absed again.
Vector projections are applied in work equations — see [SL Physics 1](/sph3u7/#work) for more information.
### Cross product
The cross product or **vector product** is a vector that is perpendicular of two vectors that are not colinear. Where $\vec{u}_1,\vec{u}_2,\vec{3}$ represent the x, y, and z coordinates of the position vector $\vec{u}$, respectively:
$$
\begin{align*}
\vec{u}\times\vec{v}&=
\begin{vmatrix}
\hat{i} & \hat{j} & \hat{k} \\
\vec{u}_1 & \vec{u}_2 & \vec{u}_3 \\
\vec{v}_1 & \vec{v}_2 & \vec{v}_3
\end{vmatrix} \\
\\
&=-\hat{j}\begin{vmatrix}
\vec{u}_1 & \vec{u}_3 \\
\vec{v}_1 & \vec{v}_3
\end{vmatrix}
+\hat{i}\begin{vmatrix}
\vec{u}_2 & \vec{u}_3 \\
\vec{v}_2 & \vec{v}_3
\end{vmatrix}
+\hat{k}\begin{vmatrix}
\vec{u}_1 & \vec{u}_2 \\
\vec{v}_1 & \vec{v}_2
\end{vmatrix} \\
\\
&=[\vec{u}_2\vec{v}_3-\vec{u}_3\vec{v}_2,\vec{u}_3\vec{v}_1-\vec{u}_1\vec{v}_3,\vec{u}_1\vec{v}_2-\vec{u}_2\vec{v}_1]
\end{align*}
$$
Cross products are:
- anti-communtative: $\vec{u}\times\vec{v}=-(\vec{u}\times\vec{v})$
- distributive: $\vec{u}\times(\vec{u}+\vec{w})=\vec{u}\times\vec{v}+\vec{u}\times\vec{w}$
- associative over scalars: $m(\vec{u}\times\vec{v})=(m\vec{u})\times\vec{v}=(m\vec{v})\times\vec{u}$
The **magnitude** of a cross product is opposite that of the dot product. Where $\theta$ is the smaller angle between the two vectors ($0\leq\theta\leq180^\circ$):
$$|\vec{u}\times\vec{v}|=|\vec{u}||\vec{v}|\sin\theta$$
This is also equal to the area of a parallelogram enclosed by the vectors — where one is the base and the other is the adjacent side.
To determine the **direction** of a cross product, the right-hand rule can be used. Spreading the fingers out:
- the thumb is the direction of the first vector
- the index finger is the direction of the second vector
- the palm faces the direction of the cross product
### Applications of vector operations
A **triple scalar product** is the result of a cross product performed first then put in a dot product.
$$|\vec{c}\bullet(\vec{a}\times\vec{b})|$$
In a **parallelpiped**, or a three-dimensional shape with six faces each a parallelogram with an identical one opposite it, the volume is the triple scalar product of the distinct three vectors that make up its side lengths:
$$A=|\vec{c}\bullet(\vec{a}\times\vec{b})|$$
For an object moving at **constant velocity in 2D space**, where $\vec{s}$ is its displacement, $\vec{s}_0$ is its initial displacement at $t=0$, $t$ is the time elapsed, and $\vec{v}$ is its velocity:
$$\vec{s}=\vec{s}_0+t\vec{v}$$
**Torque** ($\vec{\tau}$ or $\vec{M}$) is the ability to rotate an object — effectively angular/rotational force — and is the cross product of the **outward-pointing radius vector** ($\vec{r}$) and the **force** vector ($\vec{F}$).
$$
\begin{align*}
\vec{\tau}&=\vec{r}\times\vec{F} \\
&=|\vec{r}||\vec{F}|\sin\theta
\end{align*}
$$
<img src="/resources/images/torque.svg" width=700>(Source: Wikimedia)</img>
The direction of the torque can be found using the **right-hand rule**.
**Force** and **velocity** are vectors with magnitude and direction. See [SL Physics 1#Force diagrams](/sph3u7/#force-diagrams) and [SL Physics 1#Velocity](/sph3u7/#velocity) for more information.
### Operations with vector components
If **Cartesian vectors** (see [SL Physics 1#Adding/subtracting vectors algebraically](/sph3u7/#addingsubtracting-vectors-algebraically) for more details) cannot be used, the **sine and cosine laws** can be used, which are, respectively:
Where $a$, $b$, and $c$ are the lengths of a triangle, and $A$, $B$, and $C$ are their angles opposite to them:
$$\frac{\sin A}{a}=\frac{\sin B}{b}=\frac{\sin C}{c}$$
$$c^2=a^2+b^2-2ab\cos C$$
### Vector planes
A **plane** ($\pi$) is a flat surface extending infinitely in all directions and can be represented by a parallelogram.
So long as any of the following are known, their plane can be constructed:
- Two intersecting or parallel lines
- A line and a point not on the line
- 3 non-colinear points
In each scenario, an initial point $r_0$ and two direction vectors $\vec{u},\vec{v}$ can be derived to form the equation for a plane:
$$\vec r = \vec r_0 + s\vec u + t\vec v,s,t\in\mathbb R$$
This can be expanded to form the parametric form of the equation:
$$
\begin{align*}
x&=x_0+su_1+tv_1 \\
y&=y_0+su_2+tv_2 \\
z&=z_0+su_3+tv_3,s,t\in\mathbb R
\end{align*}
$$
Where $A,B.C.D$ are all integers, the **scalar** or Cartesian equation of a plane in three dimensions can be expressed as follows:
$$Ax+By+Cz+D=0$$
!!! info
$[A,B,C]$ is the **normal direction vector** of a plane.
### Interactions of planes
A line intersects a plane if the dot product between the two is not zero, and the resulting scalar multiple found can be used to find the point of intersection. Otherwise, once the equations are substituted into each other, if the statement is true, the line and plane are **parallel and coincident**. Otherwise, they are parallel.
The shortest distance between two **skew lines** $L_1$ and $L_2$ is equal to:
$$
\begin{align*}
d&=|Proj_\vec{n}\vec{P_1P_2}| \\
&=\frac{|\vec{P_1P_2}\bullet(\vec m_1\times\vec m_2)|}{|\vec m_1\times\vec m_2|}
\end{align*}
$$
The shortest distance between a point $P(x_1,y_1,z_1)$ and plane $\pi: Ax+By+Cz+D=0$ is equal to:
$$d=\frac{|Ax_1+By_1+Cz_1+D|}{\sqrt{A^2+B^2+C^2}}$$
The shortest distance between two parallel planes is equal to:
$$d=\frac{|D_1-D_2|}{\sqrt{A^2+B^2+C^2}}$$
Two planes are parallel if their direction vectors are scalar multiples of each other:
$$\vec n_1 = k\vec n_2$$
If they are also coincident, the D-values will also be identical or equal to the same scalar multiple as the normal:
$$D_1=D_2$$
Otherwise, the planes intersect, the line along which is equal to the cross product between the two direction vectors.
$$\vec m=\vec n_1\times\vec n_2$$
An initial point vector can be solved by setting any of the variables ($x,y,z$) to zero and solving for the others. Alternatively, the parameter $t$ can be set equal to one of the variables instead and the parametric equation derived that way.
The **angle between two planes** is equal to the angle between their normal direction vectors, which can be determined using the dot product formula.
When looking at three planes:
If all three normals are scalar multiples:
- If all three $D$-values are those same scalar multiples, the planes are parallel and coincident and they have infinite points of intersection along the plane equation.
- Otherwise, there are no solutions and the planes are parallel and distinct and/or parallel and coincident for two.
If two normals are scalar multiples:
- If the two parallel planes are coincident with the same $D$-values, there will be a line of intersection much like solving for intersection between two planes.
- Otherwise, the two parallel planes are distinct, forming a Z-pattern with the third plane and so there is no solution.
If no normals are scalar multiples:
- If the triple scalar product of the three planes is equal to zero, the normal vectors are not coplanar and so there will be a point of intersection.
- Alternatively, by solving the scalar equations for the planes, if:
- the result is a contradiction (e.g., $0 = 3$), there is no solution
- the result is true with no variable (e.g., $0 = 0$), there are is an infinite number of solutions along a line
- the result contains a variable (e.g., $t = 4$), there is a single point of intersection at the parameter $t$.
## Matrices
A **matrix** is a two-dimensional array with rows and columns, represented by a capital letter and a grid denoted by square brackets.
$$
A=
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6
\end{bmatrix}
$$
$A_{ij}$ represents the element in the $i$th row and the $j$th column.
A **coefficient matrix** contains coefficients of variables.
$$
A=
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6
\end{bmatrix}
$$
An **augmented matrix** also contains constants, separated by a vertical line.
$$
A=
\left[\begin{array}{rrr|r}
1 & 2 & 3 & 5 \\
4 & 5 & 6 & 10
\end{array}\right]
$$
!!! example
The equation system
$$
x+2y-4z=3 \\
-2x+y+3z=4 \\
4x-3y-z=-2
$$
can be written as the matrix
$$
A=
\left[\begin{array}{rrr|r}
1 & 2 & -4 & 3 \\
-2 & 1 & 3 & 4 \\
4 & -3 & -1 & -2
\end{array}\right]
$$
### Gaussian elimination
Gaussian elimination is used to solve a system of linear relations, such as that of plane equations. It aims to reduce a matrix into its **row echelon form** shown below to solve for each variable.
$$
A=
\left[\begin{array}{rrr|r}
a & b & c & d \\
0 & e & f & g \\
0 & 0 & h & i
\end{array}\right]
$$
The following **row operations** can be performed on the matrix to achieve this state:
- swapping (interchanging) the position of two rows
- $R_a \leftrightarrow R_b$
- multiplying a row by a non-zero constant **scalar**
- $AR_a \to R_a$
- adding/subtracting rows, overwriting the destination row
- $R_a\pm R_b\to R_b$
- multiplying a row by a non-zero constant and then adding/subtracting it to another row
- $AR_a + R_b \to R_b$
!!! example
In the matrix from the previous example, by performing $R_1\leftrightarrow R_2$:
$$
A=
\left[\begin{array}{rrr|r}
-2 & 1 & 3 & 4 \\
1 & 2 & -4 & 3 \\
4 & -3 & -1 & -2
\end{array}\right]
$$
$5R_1\to R_1$:
$$
A=
\left[\begin{array}{rrr|r}
-10 & 5 & 15 & 20 \\
1 & 2 & -4 & 3 \\
4 & -3 & -1 & -2
\end{array}\right]
$$
$10R_2+R_1\to R_1$:
$$
A=
\left[\begin{array}{rrr|r}
0 & 25 & -25 & 50 \\
1 & 2 & -4 & 3 \\
4 & -3 & -1 & -2
\end{array}\right]
$$
## Resources
- [IB Math Analysis and Approaches Syllabus](/resources/g11/ib-math-syllabus.pdf)
- [IB Math Analysis and Approaches Formula Booklet](/resources/g11/ib-math-data-booklet.pdf)
- [Textbook: Calculus and Vectors 12](/resources/g11/calculus-vectors-textbook.pdf)
- [Textbook: Oxford SL Mathematics](/resources/g11/textbook-oxford-math.pdf)
- [Course Pack Unit 1: Integration](/resources/g11/s2cp1.pdf) ([Annotated](/resources/g11/s2cp1-anno.pdf))
- [Course Pack Unit 2: Probability](/resources/g11/s2cp2.pdf)([Annotated](/resources/g11/s2cp2-anno.pdf))
- [Course Pack Unit 3: Vectors](/resources/g11/s2cp3.pdf) ([Annotated](/resources/g11/s2cp3-anno.pdf))
- [Course Pack Unit 4: Vector Applications](/resources/g11/s2cp4.pdf) ([Annotated](/resources/g11/s2cp4-anno.pdf))
- [Course Pack Unit 5: Planes](/resources/g11/s2cp5.pdf) ([Annotated](/resources/g11/s2cp5-anno.pdf))
- [TI-84 Plus Calculator Guide](/resources/g11/ti-84-plus.pdf)

View File

@ -1,747 +0,0 @@
# SL Math - Analysis and Approaches - 1
The course code for this page is **MHF4U7**.
## Review
### Logarithm rules
The logarithm of a product can be rewritten as the sum of two logarithms.
$$\log_c(ab)=\log_c(a)+\log_c(b)$$
The logarithm of a quotient can be rewritten as the difference of two logarithms.
$$\log_c\biggr(\frac{a}{b}\biggr)=\log_c(a)-\log_c(b)$$
The exponentials of a logarithm can be brought down to be coefficients.
$$\log_c(a^n)=n\log_c(a)$$
Some simple values can be easily found.
$$
a^{\log_a(x)}=x \\
\log_a(a)=1 \\
\log_a(1)=0
$$
## 3 - Geometry and trigonometry
To find the result of a primary trig ratio, the related acute angle (RAA) should first be found before referring to the CAST rule to determine quadrants before identifying all correct answers in the domain.
### Circles
The equation below is true for every point on a circle with radius $r$.
$$x^2+y^2=r^2$$
The area of a **sector** requires knowledge of the radius and angle in **radians** that the sector encompasses.
$$A=\frac{r^2\theta}{2}$$
<img src="/resources/images/sector.png" width=500>(Source: Kognity)</img>
### Trigonometric identities
The **Pythagorean identity** relates the radius of a circle to its x and y components.
$$\sin^2\theta+\cos^2\theta=1$$
The **quotient identity** relates the side lengths of a right-angled triangle.
$$\tan\theta=\frac{\sin\theta}{\cos\theta}$$
The **double angle identities** can be used to convert one trig ratio to another.
$$
\sin 2\theta = 2\sin\theta\cos\theta \\
\cos 2\theta = 2\cos^2\theta-1 \\
\cos 2\theta = \cos^2\theta-\sin^2\theta \\
\cos 2\theta = 1-2\sin^2\theta \\
\tan 2\theta = \frac{2\tan\theta}{1-\tan^2\theta}
$$
### Euler's number
Euler's number $e$ is a constant irrational number represented as a special limit in calculus.
$$e=\lim_{x\to ∞}\biggr(1+\frac{1}{x}\biggr)^x$$
The inverse of $e^x$ is $\log_e(x)$, which is known as the **natural logarithm** and can be rewritten as $\ln(x)$ ("lawn x").
## 4 - Statistics and probability
!!! note "Definition"
- **Statistics:** The techniques and procedures to analyse, interpret, display, and make decisions based on data.
- **Descriptive statistics:** The use of methods to work with and describe the **entire** data set.
- **Inferential statistics:** The use of samples to make judgements about a population.
- **Data set:** A collection of data with elements and observations, typically in the form of a table. It is similar to a map or dictionary in programming.
- **Element:** The name of an observation(s), similar to a key to a map/dictionary in programming.
- **Observation:** The collected data linked to an element, similar to a value to a map/dictionary in programming.
- **Population**: A collection of all elements of interest within a data set.
- **Sample**: The selection of a few elements within a population to represent that population.
- **Raw data:** Data collected prior to processing or ranking.
### Sampling
A good sample:
- represents the relevant features of the full population,
- is as large as reasonably possible so that it decently represents the full population,
- and is random.
The types of random sampling include:
- **Simple**: Choosing a sample completely randomly.
- **Convenience**: Choosing a sample based on ease of access to the data.
- **Systematic**: Choosing a random starting point, then choosing the rest of the sample at a consistent interval in a list.
- **Quota**: Choosing a sample whose members have specific characteristics.
- **Stratified**: Choosing a sample so that the proportion of specific characteristics matches that of the population.
??? example
- Simple: Using a random number generator to pick items from a list.
- Convenience: Asking the first 20 people met to answer a survey,
- Systematic: Rolling a die and getting a 6, so choosing the 6th element and every 10th element after that.
- Quota: Ensuring that all members of the sample all wear red jackets.
- Stratified: The population is 45% male and 55% female, so the proportion of the sample is also 45% male and 55% female.
### Types of data
!!! note "Definition"
- **Quantitative variable**: A variable that is numerical and can be sorted.
- **Discrete variable**: A quantitative variable that is countable.
- **Continuous variable**: A quantitative variable that can contain an infinite number of values between any two values.
- **Qualitative variable**: A variable that is not numerical and cannot be sorted.
- **Bias**: An unfair influence in data during the collection process, causing the data to be not truly representative of the population.
### Frequency distribution
A **frequency distribution** is a table that lists categories/ranges and the number of values in each category/range.
A frequency distribution table includes:
- A number of classes, all of the same width.
- This number is arbitrarily chosen, but a commonly used formula is $\lceil1+3.3\log({\text{# of elements})}\rceil$.
- The width (size) of each class is $\lceil\frac{\text{max} - \text{min}}{\text{# of classes}}\rceil$.
- Each class includes its lower bound and excludes its upper bound ($\text{lower} ≤ x < \text{upper}$)
- The **relative frequency** of a data set is the percentage of the whole data set present in that class in decimal form.
- The number of values that fall under each class.
- The largest value can either be included in the final class (changing its range to $\text{lower} ≤ x ≤ \text{highest}$), or put in a completely new class above the largest class.
??? example
| Height $x$ (cm) | Frequency |
| --- | --- |
| $1≤x<5$ | 2 |
| $5≤x<9$ | 3 |
| $9≤x≤14$ | 1 |
For a given class $i$, the midpoint of that class is as follows:
$$x_{i} = \frac{\text{lower bound} + \text{upper bound}}{2}$$
### Quartiles
A **percentile** is a value indicates the percentage of a data set that is below it. To find the location of a given percentile, $P_k = \frac{kn}{100}$, where $k$ denotes the percentile number and $n$ represents the sample size.
A **decile** indicates that $n×10$% of data in the data set is below it.
!!! example
A score equal to or greater than 97% of all scores in a test is said to be in the *97th percentile*, or in the *9th decile*.
Quartiles split a data set into four equal sections.
- The **minimum** is the lowest value of a data set.
- The **first quartile** ($Q_1$) is at the 25th percentile.
- The **median** is at the 50th percentile.
- The **third quartile** ($Q_3$) is at the 75th percentile.
- The **maximum** is the highest value of a data set.
The first and third quartiles are the median of the **[minimum, median)** and **(median, maximum]** respectively.
!!! warning
When the median is equal to a data point in a set, it *cannot* be used to find $Q_1$ or $Q_3$. Only use the data below or above the median.
!!! warning
When working with grouped data given in ranges, the actual data is unavailable. The five numbers above are instead:
- The minimum value is now the lower class boundary of the lowest class.
- The first and third quartiles, as well as the median, are now found by guesstimating the value on a cumulative frequency curve.
- The maximum value is now the upper class boundary of the highest class. If the highest value is excluded (e.g., $90≤x<100$), it also must be excluded when representing data (e.g., open dot instead of filled dot).
- A specific percentile can be found by guesstimating the value on a cumulative frequency curve.
The **interquartile range (IQR)** is equal to $Q_3 - Q_1$ and represents the range where 50% of the data lies.
### Outliers
Outliers are data values that significantly differ from the rest of the data set. They may be because of:
- a random natural occurrence, or
- abnormal circumstances
Outliers can be ignored once identified.
There are various methods to identify outliers. For **single-variable** data sets, the **lower and upper fences** may be used. Any data below the lower fence or above the upper fence can be considered outliers.
- The lower fence is equal to $Q_1 - 1.5×\text{IQR}$
- The upper fence is equal to $Q_3 + 1.5×\text{IQR}$
### Representing frequency
A **stem and leaf plot** can list out all the data points while grouping them simultaneously.
A **frequency histogram** can be used to represent frequency distribution, with the x-axis containing class boundaries, and the y-axis representing frequency.
<img src="/resources/images/frequency-discrete.png" width=700>(Source: Kognity)</img>
!!! note
If data is discrete, a gap must be left between the bars. If data is continuous, there must *not* be a gap between the bars.
A **cumulative frequency table** can be used to find the number of data values below a certain class boundary. It involves the addition of a **cumulative frequency** column which represents the sum of the frequency of the current class as well as every class before it. It is similar to a prefix sum array in computer science.
??? example
| Height $h$ (cm) | Frequency | Cumulative frequency |
| --- | --- | --- |
| $1≤h<10$ | 2 | 2 |
| $10≤h<19$ | 5 | 7 |
A **cumulative frequency curve** consists of an independent variable on the x-axis, and the cumulative frequency on the y-axis. In grouped data, the values on the x-axis correspond to the upper bound of a given class. This graph is useful for interpolation (e.g., the value of a given percentile).
<img src="/resources/images/cumulative-frequency-curve.png" width=700>(Source: Kognity)</img>
A **box-and-whisker plot** is a visual representation of the **"5-number summary"** of a data set. These five numbers are the minimum and maximum values, the median, and the first and third quartiles.
<img src="/resources/images/box-and-whisker.png" width=700>(Source: Kognity)</img>
!!! warning
In the image above, the maximum and minimum dots are filled. If these values were to be excluded (e.g., the upper class boundary in grouped data is excluded), they should be unfilled instead.
### Measures of central tendency
The **mean** is the sum of all values divided by the total number of values. $\bar{x}$ represents the mean of a sample while $µ$ represents the mean of a population.
$$\bar{x}=\frac{\sum x}{n}$$ where $n$ is equal to the number of values in the data set.
In grouped data, the mean can only be estimated, and is equal to the average of the sum of midpoint of all classes multiplied by their class frequency.
$$\bar{x} = \frac{\sum x_i f_i}{n}$$ where $x_i$ is the midpoint of the $i$th class and $f_i$ is the frequency of the $i$th class.
The **median** is the middle value when the data set is sorted. If the data set has an even number of values, the median is the mean of the two centre-most values.
In grouped data, the median class is the class of the $\frac{n+1}{2}$th value if the number of values in the class is odd or the $\frac{n}{2}$th value otherwise.
The **mode** is the value that appears most often.
!!! definition
- **Unimodal**: A data set with one mode.
- **Bimodal**: A data set with two modes.
- **Multimodal**: A data set with more than two modes.
- **No mode**: A data set with no values occurring more than once.
In grouped data, the **modal class** is the class with the greatest frequency.
### Measures of dispersion
These are used to quantify the variability or spread of the data set.
The **range** of a data set is simple to calculate but is easily thrown off by outliers.
$$R = \max - \min$$
The **variance** ($\sigma^2$) and **standard deviation** ($\sigma$) of a data set are more useful. The standard deviation indicates how closely the values of a data set are clustered around the mean.
$$\sigma = \sqrt{\frac{\sum f_i (x_i - \bar{x})^2}{n}}$$ where $f_i$ is the frequency of the $i$th class, $x_i$ is the midpoint of the $i$th class, $\bar{x}$ is the mean of the whole data set, and $n$ is the number of values in the data set.
For ungrouped data, assume $f_i = 1$.
In a typical bell-shaped distribution:
- 68% of data lie within 1 standard deviation of the mean ($\bar{x} ± \sigma$)
- 95% of data lie within 2 standard deviations of the mean ($\bar{x} ± 2\sigma$)
- 99.7% of data lie within 3 standard deviations of the mean ($\bar{x} ± 3\sigma$)
- any data outside 3 standard deviations of the mean can be considered outliers
!!! info
The **points of inflection** (when the curve changes direction) of a normal bell curve occur at $\bar{x} ± \sigma$.
### Data transformation
When performing an operation with a constant value to a whole data set:
| Operation | Effect on mean | Effect on standard deviation |
| --- | --- | --- |
| Addition/subtraction | Increased/decreased by constant | No change |
| Multiplication/division | Multiplied/divided by constant | Multiplied/divided by constant |
### Linear correlation and regression
!!! definition
- **Interpolation**: The prediction of values within the range of a data set.
- **Extrapolation**: The prediction of values outside the range of a data set. This tends to be less reliable than interpolation as it is unknown if the model is accurate outside of the range of the data set..
A scatter plot is used to help find trends and relationships between variables, which is primarily used to predict results not in the data set.
If there is a clear trend in the data, there is said to be a **correlation** between the independent and dependent variables.
- If the line has an upward trend, it has a positive correlation.
- If the line has a downward trend, it has a negative correlation.
The strength of the correlation ranges from none, weak, moderate, strong, and perfect, where the latter shows a line passing through all data points.
The line of best fit may not be linear. It may be quadratic, exponential, logarithmic, or there might not be a line of best fit at all. In the latter case, there is **no correlation**.
**Correlation does not imply causation**. There may be an external **confounding factor** which causes both trends, instead.
!!! example
If ice cream consumption increases as deaths from drowning increase, it does not mean that drowning causes people to eat more ice cream. The confounding factor of summer increases ice cream consumption and frequency of swimming, which leads to more people drowning.
To find the **regression line** (line of best fit), a mean data point is required. The mean data point is a new point located at the mean of all x- and y-coordinates, or $M = (\bar{x}, \bar{y})$. The regression line then is the line that passes through the mean point while minimising the *vertical* distance from every data point. This is most easily performed on a graphing display calculator (GDC), but can be calculated manually if needed.
The **least squares regression** is used to find the equation of a line that passes through the mean point for which the *square* of the vertical distance between the line and all data points (the residuals) is minimised for each point. It involves forming a line such that the sum of all residuals is $0$, and the sum of all residuals squared is minimised.
Alternatively, to manually guesstimate a linear line of best fit, a line can be drawn from the mean point to a point that best appears to lie on the line of best fit.
The **Pearson product-moment correlation coefficient** (more commonly known as *Pearson's $r$* or the *$r$-value*) quantifies the **correlation strength** of a line of best fit, or how well the line of best fit fits. This value is such that $-1≤r≤1$, where
- $r>0$ is a positive correlation
- $r<0$ is a negative correlation
- $|r|=1$ is a perfect correlation
- $0.7≤|r|<1$ is a strong correlation
- $0.3≤|r|<0.7$ is a weak to moderate correlation
- $0≤|r|<0.3$ is no correlation, so that no line of best fit can be drawn.
## 5 - Calculus
### Rate of change
The **average rate of change (ARoC)** between points $P(a, f(a))$ and $Q(a + h, f(a+h))$ is represented by the slope of the **secant line ($m_s$)**. Therefore, as slope is the difference in rise over the difference of run ($\frac{\Delta y}{\Delta x}$), the slope of the secant line can be expressed as
$$m_s = \frac{f(a+h)-f(a)}{h}, h ≠ 0$$
This is known as the **difference quotient**.
The **instantaneous rate of change (IRoC)** at point $P(a, f(a))$ is represented by the slope of the **tangent line ($m_T$)**. The slope of the tangent line can be found by finding the difference quotient with $h$ as a very small value, e.g., $0.001$.
!!! warning
The above method of finding the IRoC should be disregarded in favour of finding the derivative.
### Sequences
A sequence is a **function** with a domain of all positive integers in sequence, but uses subscript notation ($t_n$) instead of function notation ($f(x)$).
!!! reminder
- The **recursive** formula for a sequence is $t_n = t_{n-1} + 2$ where $t_1 = 1$.
- The **arithmetic** formula for a sequence is $t_n = 2n-1$.
If the sequence is infinite, as $n$ becomes very large:
- If the sequence continuously grows, it **tends to infinity**. (E.g., $a_n = n^2, n ≥ 1$)
- If the sequence gets closer to a real number and converges on it, it **converges to a real limit**, or is **convergent**. (E.g., $a_n = \frac{1}{n}, n ≥ 1$)
- If the sequence never approaches a number, it **does not tend to a limit**, or is **divergent**. (E.g., $a_n = \sin(n \pi)$)
### Limits
A **limit** to a function is the behaviour of that function as a variable approaches, **but does not equal**, another variable.
!!! example
$$\lim_{x \to c} f(x) = L$$
"The limit of $f(x)$ as $x$ approaches $c$ is $L$."
If the lines on both sides of a limit do not converge at the same point, that limit *does not exist*.
If the lines on both sides of a limit become arbitrarily large as $x$ approaches $a$, it approaches infinity.
$$\lim_{x \to a} f(x) = ∞$$
### One-sided limits
A positive or negative sign is used at the top-right corner of the value approached to denote if that limit applies only to the negative or positive side, respectively. A limit without this sign applies to both sides.
!!! example
- $\lim_{x \to 3^-} f(x) = 2$ shows that as $x$ approaches $3$ from the negative (usually left) side, $f(x)$ approaches $2$.
- $\lim_{x \to 3^+} f(x) = 2$ shows that as $x$ approaches $3$ from the positive (usually right) side, $f(x)$ approaches $2$.
- $\lim_{x \to 3} f(x) = 2$ shows that as $x$ approaches $3$ from either side, $f(x)$ approaches $2$.
If $\lim_{x \to c^-} f(x) ≠ \lim_{x \to c^+} f(x)$, $\lim_{x \to c} f(x)$ **does not exist**.
### Properties of limits
The following properties assume that $f(x)$ and $g(x)$ have limits at $x = a$, and that $a$, $c$, and $k$ are all real numbers.
- $\lim_{x \to a} k = k$
- $\lim_{x \to a} x = a$
- $\lim_{x \to a} [f(x) ± g(x)] = \lim_{x \to a} f(x) ± \lim_{x \to a} g(x)$
- $\lim_{x \to a} [f(x) \cdot g(x)] = [\lim_{x \to a} f(x)] [\lim_{x \to a} g(x)]$
- $\lim_{x \to a} [k \cdot f(x)] = k \cdot \lim_{x \to a} f(x)$
- $\lim_{x \to a} [f(x)]^2 = [\lim_{x \to a} f(x)]^2$
### Evaluating limits
When solving for limits, there are five central strategies used, typically in this order if possible:
#### Direct substitution
Substitute $x$ as $a$ and solve.
??? example
$$
\lim_{x \to 5} (x^2 + 4x + 3) \\
= 5^2 + 4(5) + 3 \\
= 48
$$
If **only** direct substitution fails and returns $\frac{0}{0}$, continue on with the following steps. If **only** the denominator is $0$, the limit **does not exist**.
#### Factorisation, expansion, and simplification
Attempt to factor out the variable as much as possible so that the result is not $\frac{0}{0}$, and then perform direct substitution.
??? example
$$
\lim_{x \to 1} \frac{x^2 - 1}{x-1} \\
= \lim_{x \to 1} \frac{(x + 1) (x - 1)}{x-1} \\
= \lim_{x \to 1} (x+1) \\
= 1 + 1 \\
= 2
$$
#### Rationalisation
If there is a square root, multiplying both sides of a fraction by the conjugate may allow direct substitution or factorisation.
??? example
$$
\lim_{x \to 0} \frac{\sqrt{1-x}-1}{x} \\
= \lim_{x \to 0} \frac{\sqrt{1-x}-1}{x} \cdot \frac{\sqrt{1-x}+1}{\sqrt{1-x}+1} \\
= \lim_{x \to 0} \frac{1-x - 1}{x\sqrt{1-x} + x} \\
= \lim_{x \to 0} \frac{1}{\sqrt{1-x} + 1} \\
= \frac{1}{\sqrt{1-0} + 1} \\
= \frac{1}{2}
$$
#### One-sided limits
There may only be one-sided limits. In this case, breaking the limit up into its two one-sided limits can confirm if the two-sided limit does not exist when looked at together.
#### Change in variable
Substituting a variable in for the variable to be solved and then solving in terms of that variable may remove a problem variable.
??? example
$$
\lim_{x \to 0} \frac{x}{(x+1^\frac{1}{3}-1} \\
\text{let } (x+1)^\frac{1}{3} \text{ be } y \\
x + 8 = y^3 \\
x = y^3 - 8, \text{as } x \to 0, y \to 2 \\
\lim_{y \to 2} \frac{y-2}{y^3 - 8} \\
= \lim_{y \to 2} \frac{(y-2)(y^2 + 4y + 4)}{(y^3-8)(y^2 + 4y + 4)} \\
= \lim_{y \to 2} \frac{1}{y^2 + 4y + 4} \\
= \frac{1}{2^2 + 4(2) + 4} \\
= \frac{1}{16}
$$
!!! note
If $\lim_{x \to a} \frac{f(x)}{g(x)}$ exists and direct substitution is not possible, $x - a$ *must* be a factor of both $f(x)$ and $g(x)$ so that the discontinuity can be removed. Therefore, $f(a) = 0$ and $g(a) = 0$.
### Limits and continuity
If a function has holes or gaps or jumps (i.e., if it cannot be drawn with a writing utensil held down all the time), it is **discontinuous**. Otherwise, it is a **continuous** function. A function discontinuous at $x=a$ is "discontinuous at $a$", where $a$ is the "point of discontinuity".
A **removable discontinuity** occurs when there is a hole in a function. It can be expressed as when either
$$
f(a) = \text{DNE or} \\
\lim_{x \to a} f(x) ≠ f(a)
$$
A **jump discontinuity** occurs when both one-sided limits have different values. It is common in piecewise functions. It can be expressed as when
$$\lim_{x \to a^-} f(x) ≠ \lim_{x \to a^+} f(x)$$
An **infinite discontinuity** occurs when both one-sided limits are infinite. It is common when functions have vertical asymptotes. It can be expressed as when
$$\lim_{x \to a} f(x) = ± ∞$$
Therefore, a function is only continuous at $a$ if all of the following are true:
- $f(a)$ exists
- $\lim_{x \to a^-} f(x) = \lim_{x \to a^+} f(x)$
- $\lim_{x \to a} f(x) = f(a)$
### Limits approaching infinity
As $x$ approaches infinity, $\lim_{x \to ∞} f(x)$ has only three possible answers.
By dividing both sides of a fraction by the $x$ variable of the highest degree, if $m$ is the degree of the denominator and $n$ is the degree of the numerator:
- If $m > n$, $\lim_{x \to ∞} f(x) = 0$
- If $m < n$, $\lim_{x \to ∞} f(x) = ± ∞$
- The sign of infinity can be found by evaluating the limit
- If $m = n$, $\lim_{x \to ∞} f(x) = \frac{a}{b}$, where $a$ and $b$ are the coefficients of the degree of the numerator and the denominator, respectively.
### Derivatives
A derivative function is a function of all **tangent slopes** in the original function. It can either be expressed in function notation as $f´(x)$ ("f prime of x") or in Leibniz notation as $\frac{dy}{dx}$. The process of finding a derivative of a function is known as **differentiation**.
!!! note
Although evaluating a derivative function in function notation is the usual $f´(5)$ to solve for when $x = 5$, Leibniz notation is stupid and requires the following (the vertical bar shown should be solid):
$$\frac{dy}{dx} \biggr|_{x=5}$$
If $f´(a)$ exists, the function is "differentiable at $a$" such that $f´(a^-) = f´(a^+)$. Functions are only differentiable at $a$ if the function is **continuous at $a$** and the tangent at $a$ is not vertical.
!!! example
Some examples of issues that can cause $f´(a)=\text{DNE}$ are vertical asymptotes and other discontinuities, vertical tangents, cusps, and corners. The last two cause $f´(a^-) ≠ f´(a^+)$.
### Finding derivatives using first principles
The first principles method of finding derivatives involves using simple algebra and limits. Taking the difference quotient and adding a limit of $h \to 0$:
$$f´(x)=\lim_{h \to 0} \frac{f(x+h)-f(x)}{h}$$
results in the equation of the derivative function. Direct substitution of $h$ will result in an indeterminate form, so the equation should be manipulated to remove $h$ from the denominator typically via factoring.
??? example
Differentiating $f(x)=2x^2 + 6$ using first principles:
$$
f´(x)=\lim_{h \to 0} \frac{f(x+h)-f(x)}{h} \\
= \lim_{h \to 0} \frac{2(x+h)^2 + 6 - (2x^2 - 6)}{h} \\
= \lim_{h \to 0} \frac{4xh+2h^2}{h} \\
= \lim_{h \to 0} 4x+2h \\
f´(x)=4x
$$
### Drawing derivative functions
If the slope of a tangent is:
- positive/negative, that value on the derivative graph is also positive/negative, respectively
- zero, that value on the derivative graph is on the x-axis
Points of inflection on the original function become maximum/minimum points on the derivative graph.
The derivative of a linear equation is always constant, and the derivative of a constant value is $0$..
### Derivative rules
These rules can be used in place of/to supplement finding derivative functions using first principles and are usually much faster to calculate. These rules assume that all of the functions involved are differentiable.
The degree of a derivative is always the degree of the original function$-1$.
The **power rule** applies to all functions of the form $f(x)=x^n,x \in \mathbb{R}$, such that:
$$f´(x) = nx^{n-1}$$
??? example
$$f(x) = x^5$$
$$f´(x) = 5x^4$$
The **constant multiple rule** applies to all functions of the form $f(x) = k·g(x)$, where $k$ is any real number, such that:
$$f´(x) = k·g´(x)$$
??? example
$$f(x) = 2x^2$$
$$f´(x) = 2·2x$$
$$f´(x) = 4x$$
The **sum rule** applies to all functions of the form $f(x) = g(x) + h(x)$ such that:
$$f´(x) = g´(x) + h´(x)$$
??? example
$$f(x) = 2x^2 + 3x$$
$$f´(x) = 4x + 3$$
The **product rule** applies to all functions of the form $f(x) = g(x)h(x)$ such that:
$$f´(x) = g´(x)h(x) + g(x)h´(x)$$
??? example
$$f(x) = (2x+5)(x-1)$$
$$f´(x) = 2(x-1) + (2x+5)·1$$
$$f´(x) = 4x + 1$$
The **extended product rule** applies to all functions of the form $f(x) = g(x)h(x)j(x)$ such that:
$$f´(x) = g´(x)h(x)j(x) + g(x)h´(x)j(x) + g(x)h(x)j´(x)$$
The **quotient rule** applies to all functions of the form $f(x) = \frac{g(x)}{h(x)}$ such that:
$$f´(x) = \frac{g´(x)h(x)-g(x)h´(x)}{[h(x)]^2}, h(x) ≠ 0$$
??? example
$$f(x) = \frac{2x+5}{x-1}$$
$$f´(x) = \frac{2(x-1) - (2x+5)·1}{(x-1)^2}$$
$$f´(x) = -\frac{7}{(x-1)^2}$$
The **chain rule** applies to all functions of the form $f(x) = g(h(x))$ such that:
$$f´(x) = g´(h(x)) · h´(x)$$
??? example
$$f(x) = (4x^2-3x+1)^7$$
$$f´(x) = 7(4x^2-3x+1)^6 (8x-3)$$
### Trigonometric derivative rules
$$
\frac{d}{dx}\sin x = \cos x \\
\frac{d}{dx}\cos x = -\sin x \\
$$
These primary derived rules can be used to further derive the derivatives of the other trignometric ratios:
$$
\frac{d}{dx}\tan x = \sec^2 x \\
\frac{d}{dx}\csc x = -\csc x\cdot\cot x \\
\frac{d}{dx}\sec x = \sec x\cdot\tan x
$$
The **chain rule** applies to trigonometric functions and will be applied recursively if needed.
!!! example
$$\frac{d}{dx}[\sin g(x)]^n = n[\sin g(x)]^{n-1}\cdot\cos x\cdot g´(x)$$
Trigonometric identities are not polynomial so values on an interval need to be determined by substituting values between vertical asymptotes and critical points.
### Extended derivative rules
For an **exponential function** where $f(x)=b^x,b≠0$ or $f(x)=b^{g(x)}$, respectively:
$$
f´(x)=b^x\cdot\ln(b) \\
f´(g(x))=b^{g(x)}\cdot\ln(b)\cdot g´(x)
$$
For a **logarithmic function** where $f(x)=\log_b(x)$ or $f(x)=\log_b(g(x))$, respectively:
$$
f´(x)=\frac{1}{\ln(b)\cdot x} \\
f´(x)=\frac{g´(x)}{\ln(b)\cdot g(x)}
$$
From the above base derivatives the derivatives for functions involving $e$ and the **natural logarithm** can be found:
$$
\frac{d}{dx}e^x=e^x \\
\frac{d}{dx}e^{g(x)}=e^{g(x)}\cdot g´(x) \\
\frac{d}{dx}\ln(x)=\frac{1}{x} \\
\frac{d}{dx}\ln(g(x))=\frac{g´(x)}{g(x)}
$$
This opens up the possibility of **logarithmic differentiation**, which is required for exponential or logarithmic functions with a variable base. The **natural logarithm** of both sides should be taken prior to differentiation and logarithmic rules applied to simplify the equation.
### Higher order derivatives
The **second derivative** of $f(x)$ is the derivative of the first derivative of $f(x)$, that is, $f´´(x)$.
The $n$th derivative of $f(x)$ is $f^{(n)}(x)$, and is the derivative of the $n-1$th derivative. It is written as $\frac{d^ny}{dx^n}$ in Leibniz notation.
!!! example
The second derivative of an object's position with respect to time is its acceleration. See [SL Physics A#Displaying motion](/sph3u7/#displaying-motion) for more information.
### Interval charts
To identify the positive or negative regions of an equation, an interval line or chart can be used. To do so:
1. Factor the equation as much as possible and identify the x-intercepts.
2. Place the x-intercepts on a line.
3. Find the sign of the end behaviour by taking the sign of the leading coefficient.
4. When crossing an x-intercept, if the degree of that factor is even, the sign stays the same; otherwise, it alternates.
5. Repeat for every other region.
### Implicit differentiation
Implicit differentiation differentiates both sides of an equation with respect to $x$ and solves for $\frac{dy}{dx}$ ($y´$). Note that if $y$ is isolated, this is effectively the same as explicit differentiation. When differentiating implicitly, it must be shown that the derivative of both sides with respect to x ($\frac{d}{dx}$) is being taken.
!!! warning
The **chain rule** must be applied when differentiating terms that contain $y$.
!!! example
$$
\frac{x^2}{4} + y^2 = 1 \\
\frac{2x}{4} + 2y · \frac{dy}{dx} = 0 \\
\frac{dy}{dx} = -\frac{\frac{x}{2}}{2y} \\
\frac{dy}{dx} = -\frac{x}{4y}
$$
### Related rates
When solving for questions that ask for rate of change related to other rates of change, ensure that:
- variables are defined
- equations are written in terms of derivates
- the equations are differentiated **with respect to time**
- apply derivative rules (especially the chain rule) to every variable that is not a constant (i.e., that changes with respect to time)
- substitute values only at the end
## 5.2 - Increasing and decreasing functions
- If $f´(x) > 0$ in the interval $[a,b]$, $f$ is **increasing** on $[a,b]$.
- If $f´(x) < 0$ in the interval $[a,b]$, $f$ is **decreasing** on $[a,b]$.
- If $f´(x) = 0$ in the interval $[a,b]$, $f$ is **constant** on $[a,b]$.
- The points where $f´(x)=0$ are the **critical**/maximum/minimum points.
Functions only change whether they are increasing/decreasing/constant at the **critical points**/"relative extrema".
These points and whether the intervals between them increase/decrease can be found by using an **interval chart/line** using the first derivative.
!!! example
If $f(x)=\frac{2x-3}{x^2+2x-3}$:
- $f$ is decreasing on $(-∞, -3) \cup (-3, 0) \cup (3, ∞)$.
- $f$ is increasing on $(0, 1) \cup (1, 3)$.
### Extrema
Extrema are the maximum and minimum points in a function or an interval of a function. They must be at **critical points**—where $f(x)=0$ or $f(x)=\text{DNE}$, and may include the **boundary points** if looking for extrema in a given interval.
The highest and lowest point(s) of $f(x)$ are known as the **absolute** maximum/minimum of $f(x)$.
Any other **relative/local** maxima or minima are such that all of the points around that point are higher or lower.
**Fermat's theorem** states that if $f(c)$ is a local extremum, $c$ must be a critical number of $f$. Therefore, if $f$ is continuous in the closed interval $[a,b]$, the absolute extrema of $f$ must occur at $a$, $b$, or a critical number.
To find the extrema of a **continuous** function $f(x)$, where $x=a$ is a critical value, the **first derivative test** may be used with the assistance of an interval chart/line. If only an interval of a function is under consideration, the boundary points must be taken under consideration as well.
- If $f´(a)$ changes from positive to negative, there is a relative/local minimum at $x=a$.
- If $f´(a)$ changes from negative to positive, there is a relative/local maximum at $x=a$.
- If the sign is the same on both sides, there is no extrema at $x=a$.
- The greatest/least relative/local maximum/minimum is the absolute maximum/minimum.
Alternatively, the second derivative test may be used instead. At the critical point where $x=a$, a positive $f´´(a)$ indicates a **local minimum** while a negative $f´´(a)$ indicates a **local maximum**. If $f´´(x)=0$, the test is inconclusive and the first derivative test must be used.
!!! example
The absolute minimum of $f(x)=x^2$ is at $(0,0)$. There is no absolute maximum nor are there any other relative/local maximum/minimum points.
!!! warning
- There can be multiple absolute maxima/minima if there are multiple points that are both highest/lowest.
- If a function is a horizontal line, the absolute maximum and minimum for $x \in \text{domain}$ is $y$.
### Concavity
!!! definition
A **point of inflection** on a curve is such that $f´´(x)=0 \text{ or DNE}$ and the signs of $f´´(x)$ around the point change (e.g., positive to negative).
- An interval is **concave up** if it increases from left to right and tangent lines are drawn below the curve, so $f´´(x)>0$. It is shaped like a smile.
- An interval is **concave down** if it increases from left to right and tangent lines are drawn **above** the curve, and $f´´(x)<0$. It is shaped like a frown.
Changes in concavity only occur at points of inflection.
### Cusps
A cusp is a point on a continuous function that is not differentiable as the slopes on both sides approach -∞ and ∞. Concavity does not change at a cusp, but they may be considered for local extrema.
### Optimisation
To optimise for a maximum or minimum of a variable:
- Identify an equation with only one variable dependent on another
- Find the first derivative and identify critical points
- Use the second derivative test to identify if the critical point is a maximum or minimum
- Check constraints and throw away any inadmissible results
Diagrams with labelled variables may be helpful.
### Asymptote behaviour
The vertical asymptotes of a function are at values of $x$ that make the denominator of the simplified function $0$. The behaviour near them can be found using limits as $x$ approaches those points.
The horizontal asymptotes of a function can be found as $x$ approaches positive and negative infinity. To determine behaviour near them, the sign of $\lim_{xs \to ±∞} f(x) - L$, where $L$ is the y-coordinate of the asymptote. A positive limit indicates that $f(x)$ is above the asymptote while a negative limit indicates that $f(x)$ is below the asymptote.
### Curve sketching
- Determine the domain of the function and consider discontinuities (holes and asymptotes)
- Determine the y-intercept and if easy, x-intercepts
- Determine the behaviour near vertical and horizontal asymptotes
- Identify critical points by solving $f´(x)=0$ or $f´(x)=\text{DNE}$
- Use the first or second derivative tests to test critical points
- Identify points of inflection by solving $f´´(x)=0$ or $f´´(x)=\text{DNE}$ and test concavity on both sides of possible points
## Resources
- [IB Math Analysis and Approaches Syllabus](/resources/g11/ib-math-syllabus.pdf)
- [IB Math Analysis and Approaches Formula Booklet](/resources/g11/ib-math-data-booklet.pdf)
- [Calculus and Vectors 12 Textbook](/resources/g11/calculus-vectors-textbook.pdf)
- [Course Pack Unit 1: Descriptive Statistics](/resources/g11/s1cp1.pdf) ([Annotated](/resources/g11/s1cp1-anno.pdf))
- [Course Pack Unit 2: Limits and Rate of Change](/resources/g11/s1cp2.pdf) ([Annotated](/resources/g11/s1cp2-anno.pdf))
- [Course Pack Unit 3: Derivatives and Applications](/resources/g11/s1cp3.pdf) ([Annotated](/resources/g11/s1cp3-anno.pdf))
- [Course Pack Unit 4: Curve Sketching and Optimisation](/resources/g11/s1cp4.pdf) ([Annotated](/resources/g11/s1cp4-anno.pdf))
- [Course Pack Unit 5: Trigonometric, Exponential, and Logarithmic Functions](/resources/g11/s1cp5.pdf) ([Annotated](/resources/g11/s1cp5-anno.pdf))
- [TI-84 Plus Guide](/resources/g11/ti-84-plus.pdf)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,574 +0,0 @@
# SL Physics - 2
The course code for this page is **SPH4U7**.
## Magnetism
Magnets are objects with north/south dipoles that create a field around them. Although ferromagnetic substances can repel each other, paramagnetic substances are always attracted to a magnetic field. See [HL Chemistry#Physics properties of transition elements](/sch3uz/#physical-properties-of-transition-elements) for more details.
### Magnetic fields
<img src="/resources/images/magnetic-field.png" width=700>(Source: Kognity)</img>
Similar to electric and gravitational fields, magnetic fields (also known as **B-fields**) are drawn by their effect on a north pole. Since magnetic poles always appear in equal magnitude pairs, all magnetic field lines for a magnet must form closed loops from north to south **outside** and south to north **inside** the magnet. Much like electric field lines, magnetic field lines never touch
<img src="/resources/images/more-magnetic-fields.png" width=700>(Source: Kognity)</img>
Atoms in ferromagnetic materials are tiny magnets with **dipoles**. These dipoles act on neighbouring dipoles and can cause the whole object to align — this is known as an **electric domain**.
!!! note
Nickel, cobalt, or any alloy with nickel, cobalt, or iron can become magnetised this way.
**Unmagnetised** domains have dipoles pointing in random directions that are aligned when exposed to a magnetic field where they become **magnetised** domains. As such, bar magnets are always broken into smaller magnets, each with two poles — a monopole is impossible to create.
### Straight-line electromagnets
Moving electric charges produce magnetic fields. A circle filled with an "x" indicates that the current is moving away from the viewer in the third dimension while a dotted circle indicates it is moving toward the viewer.
These magnetic fields are centred on the conductor, are in a plane perpendicular to the conductor, and have decreasing magnetic field strength over distance.
<img src="/resources/images/straight-line-electromagnet.png" width=700>(Source: Kognity)</img>
The **right-hand rule** for straight-line conductors indicates that when the conductor would be grasped by the right hand, the thumb would point in the direction of current and the fingers pointing in the direction of the magnetic field.
<img src="/resources/images/right-hand-rule.png" width=700>(Source: Kognity)</img>
### Solenoid electromagnets
A **solenoid** is a conductor coil in a tight helix. Current passed through a solenoid will generate a **uniform magnetic field** inside the coil with a pattern identical to that of a bar magnet outside it.
<img src="/resources/images/selenoid-electromagnet.png" width=700>(Source: Kognity)</img>
The right-hand rule can be applied again to a solenoid to identify the direction of the north pole or direction of magnetic field in the coil:
<img src="/resources/images/selenoid-right-hand-rule.png" width=700>(Source: Kognity)</img>
### Properties of moving charges
As only moving electric charges generate magnetic fields, stationary electric charges are **unaffected** by external magnetic fields. Moving charges are affected by Newton's third law of motion — equal and opposite forces are exerted on the charge and the magnet. As such, where $q$ is the charge of the particle and $\vec{v}\times \vec{B}$ is the **cross product** (vector multiplication) of the velocity of the particle and the magnetic field strength in Teslas:
$$\vec{F_m}=q\vec{v}\times \vec{B}$$
**Magnetic field strength** ($B$) represents the force acting per unit current in a conductor of unit length perpendicular to the field with the unit Tesla ($\pu{T}$)
The **magnetic force** is always plane **perpendicular** to both $\vec{v}$ and $\vec{B}$. Just the magnitude of the force can be found by using the angle between the two vectors ($\theta$):
$$|F_m|=qvB\sin\theta$$
Regardless of $\theta$, the force vector is always perpendicular to both $B$ and $v$,
The above equation can be rearranged to find **electromagnetic** force in terms of current and wire length in a **uniform magnetic field**:
$$|F_{em}|=BIL\sin\theta$$
<img src="/resources/images/magnet-on-wire.png" width=700>(Source: Kognity</img>
The **right-hand-rule** can be used to determine the direction of force — the thumb points in the direction of current/velocity, the fingers point in the direction of the magnetic field, and the palm points in the direction of force. Alternatively, just three fingers can be used.
<img src="/resources/images/right-hand-rule-forces.png" width=700>(Source: Kognity)</img>
When two straight-line conductors with current flowing through them are brought together, they either mutually attract or repel. The ampere is defined based on the current required to flow through a scenario involving two parallel straight-line conductors.
<img src="/resources/images/parallel-current-conductors.png" width=700>(Source: Kognity)</img>
Inside a **uniform magnetic field**, charges move in **uniform circular motion** at a constant velocity. If the particle did not enter the field at a perfect right angle, some of the velocity is used to change the path of the particle to be in a spiral — still perfectly circular, but additionally moving in the third dimension perpendicular to the circle.
$$\Sigma F_c = F_m$$
## Nukes
### Atomic structure
!!! definition
- A **photon** is a particle that represents light.
- A **nucleon** is a subatomic particle in an atomic nucleus — that is, a proton or neutron.
- A **nuclide** is a nucleus with a specific number of protons and neutrons.
Please see [HL Chemistry#2.1 - Atoms](/sch3uz/#21-atoms) and [HL Chemistry 1#2.2 - Electrons in atoms](/sch3uz/#22-electrons-in-atoms) for more information.
An electron in an atom will only become excited if a photon of exactly the right amount of energy strikes it. That energy can be found using the formula:
$$\Delta E=hf$$
where $E$ is the energy of the photon at frequency $f$, and $h$ is Planck's constant ($\pu{6.63\times 10^{-34} Js}$ or $\pu{4.14\times10^{-15} eVs}$).
An electron that de-excites will emit a photon of that exact energy and thus frequency to return to its previous state.
### Binding energy
According to Einstein's theory of special relativity:
$$\Delta E=\Delta mc^2$$
**Neutrons** in the nucleus hold the protons together via **strong nuclear forces** that somewhat act like glue. An increase in neutrons increases the strong nuclear force. In smaller nuclei, $N=Z$, but in larger nuclei, $N>Z$ as more neutrons are required to keep the nucleus stable as the number of protons increases.
The mass of a stable nucleus is always less than the sum of the masses of the individual nucleons (the **mass defect**) as some of the mass is converted to energy during the formation of a nucleus. The energy used is known as the **binding energy** of a nucleus.
$$E_\pu{binding} = \pu{mass defect}\times c^2$$
As such, the binding energy of a nucleus is also the energy required to separate it completely into individual nucleons.
Atomic mass is measured relative to the mass of a carbon-12 atom, which is exactly 12 u (unified atomic mass units).
$$\pu{1 u}=\pu{1.661\times10^{-27} kg}=\pu{931.5 MeVc^-2}$$
A higher **binding energy per nucleon** results in more energy required to break it apart and thus it being more stable.
<img src="/resources/images/binding-energy-curve.png" width=700>(Source: Kognity)</img>
!!! note
It is required to know the general shape of the curve, that $~8.8 \pu{ MeV}$ is the maximum, and that the end boundaries are $0$ and $~7.5 \pu{ MeV}$. It is also required to know the elements at each of those points (hydrogen-1, iron-56/nickel-62, and uranium-238).
Since a greater binding energy per nucleon is more energetically favourable, nuclei to the right of iron-56 fission (split) while those to the left fuse (combine) to release energy — changes that would increase binding energy per nucleon are likely to occur because of this.
### Radioactive decay
!!! definition
- An **alpha particle** is a helium-4 nucleus (2 protons, 2 neutrons).
- A **beta particle** is an electron.
- A **gamma ray** is a photon.
Radioactivity is the emission of **ionising** (will make ions) radiation due to changes of a nucleus. It is **random** and spontaneous — it is unaffected by external factors such as other nuclei decaying.
**Nuclear equations** are similar to chemical equations but show how nuclei change in a nuclear process by tracking the atomic and mass numbers. A nuclear equation is balanced so that the sum of the atomic and the sum of the mass numbers on both sides are equal.
$$A\to B+C$$
**Alpha decay** occurs when the strong nuclear force is unable to hold a large nucleus together and emits an alpha particle. The alpha particle is positive and can barely penetrate paper. The two particles move in opposite directions with momentums equal in magnitude.
<img src="/resources/images/alpha-decay.png" width=700>(Source: Kognity)</img>
$$\ce{^A_Z N → ^{A-4}_{Z-2} N' + ^4_2 He}$$
$\ce{^4_2 He}$ may be replaced by $\ce{^4_2\alpha}$.
!!! example
Radium-226 alpha decays to radon-222.
**Beta-minus decay** ($\beta^-$) occurs when a neutron decays into a proton and releases a beta-minus particle (an electron and an electron antineutrino). It can penetrate up to 3 mm of aluminum. Where $\overline{v}_e$ is the antineutrino:
<img src="/resources/images/beta-minus-decay.png" width=700>(Source: Kognity)</img>
$$\ce{^1_0n → ^1_1p + ^0_{-1}e + ^0_0\overline{v}_e}$$
!!! note
The bar over the electron antineutrino identifies it as an **antiparticle**.
The beta-minus particle can be written explicitly over the electron as $^0_{-1}\beta$.
In terms of the mother nucleus, the reaction results in the mass number staying the same while the atomic number increases by one.
**Beta-plus decay** ($\beta^+$) occurs when a proton decays into a neutron and releases a **positron** (an antielectron with a positive charge) and an electron neutrino ($v_e$)
$$\ce{^1_1p → ^1_0n + ^0_1e + ^0_0v_e}$$
The positron can be written as a beta-plus particle as $^0_1\beta$.
In terms of the mother nucleus, the reaction results in the mass number staying the same while the atomic number decreases by one.
**Gamma decay** occurs when an excited nucleus transfers its energy to a high-energy photon with frequencies in the gamma region of the electromagnetic spectrum. There is no change in mass nor atomic number. A nuclide with an asterisk $*$ indicates it as excited. This emits *ionising radiation* which is not good for living beings.
<img src="/resources/images/gamma-decay.png" width=700>(Source: Kognity)</img>
$$\ce{^A_ZX^* → ^A_ZX + ^0_0\gamma}$$
### Detecting radiation
As radiation cannot be seen, it must be detected experimentally.
A **Geiger counter** utilises a gas-filled tube with a wire in the centre at high voltage. When a charged particle passes through, gas is ionised which cascade onto the wire to produce a pulse.
A **cloud chamber** contains vapour that turns into liquid droplets when ionising particles pass though, resulting in visible lines showing the path of the particles. A magnetic field can spiral the particle in a certain direction which allows for its charge to be identified.
### Half-life
The **half-life** of an element is the time required for half of the nuclides in a sample to decay — it is always the same no matter the number of initial nuclides.
As such, this means that the number of parent nuclei decreases by 50% of its current value each half-life.
<img src="/resources/images/half-life.png" width=700>(Source: Kognity)</img>
!!! example
**Radioactive dating** analyses the ratio between carbon-14 and carbon-12 to determine the age of plant nmatter. As the ratio of C-14 and C-12 in the atmosphere has been relatively comstant, living plants maintain that balance by constantly exchanging carbon. Dead plants' carbon-14 slowly decay at a known rate, so the ratio can be used to determine the time since the plant died.
### Nuclear reactions
A nuclear reaction occurs when a nucleus is hit by another nucleus or subatomic particle and a different nuclide is formed (nuclear **transmutation**). In such a collision, energy and momentum must be conserved. Generally, neutrons are most commonly used in these reactions as they are not affected by Coulomb force exerted by the protons or electrons.
The **reaction energy** $Q$ is the difference in mass between the initial and final states multiplied by $c$ squared. In the sample reaction $a+X → Y+b$:
$$Q=[(M_a + M_X) - (M_Y + M_b)]c^2$$
- If $Q$ is positive, the reaction is **exothermic** and will occur at any amount of initial kinetic energy.
- If $Q$ is negative, an initial kinetic energy equal to $Q$ is required (the activation energy).
Nuclear **fusion** occurs when two lighter nuclei combine into a heavier one, releasing energy in the process.
Nuclear **fission** occurs when a heavy nucleus splits into two lighter nuclei. Along with some excess neutrons, energy is released. The two split pieces are usually somewhat unequal.
### Fission in reactors
The energy release of nuclei is very large — the energy density per unit mass is much higher than any other conventional source.
As nuclei get smaller, their stablility increases as the number of neutrons also decreases, so excess neutrons can set off a chain reaction by reacting with more nuclei.
<img src="/resources/images/fission-chain.gif" width=700>(Source: Kognity)</img>
However, neutrons that are ejected often have too much energy and must be **moderated** to slow down to prevent a critical mass where the number of reactions is self-sustaining, leading to overheating and reactor meltdown. A **moderator** is a material surrounding fuel rods to slow down incoming neutrons — usually heavy water.
**Control rods** are also inserted into the reaction core to control the rate of reaction. These absorb the neutrons from the moderator and the amount absorbed can be adjusted by raising the rods partially up to all the way from the reactor.
Nuclear power is superior to other types of energy generation in that:
- it has a high power output due to high energy density
- there are large reserves of nuclear fuel on Earth
- there are no greenhouse gases emitted to generate power
Nuclear power has the following issues in that:
- waste is highly radioactive with long half-lives, rendering removal and storage of nuclear waste a major issue
- initial startup costs are expensive
- strict maintenance is required due to the risk of nuclear meltdown
- fissionable fuel can be recovered and used for destructive weapons
- mining uranium is unhealthy — miners are exposed to harmful radiation and waste material from mines deemed not pure enough is not easy to dispose
### Nuclear fusion
Nuclear fusion generates energy per unit mass an order of magnitude greater than can be achieved with fission. The sun takes hydrogen and fuses it into helium. Heavier stars can fuse elements up to iron-56.
$$\ce{4 ^1_1 H → ^4_2 He + 2 e^+ + 2 v_e + 2\gamma}$$
Nuclear fusion power has the following issues in that it is currently unsustainable for more than a few seconds because:
- the temperature required for the reaction is greater than 100 million degrees Celsius
- it requires more energy input to heat the sample than is obtained from the fusion reaction
- materials currently known cannot withstand the temperature making containment difficult — currently magnetic fields are used to hold the particles in place
## The Standard Model
<img src="/resources/images/standard-model.png" width=700>(Source: Kognity)</img>
### Elementary particles
An elementary particle is a subatomic particle that is not composed of other particles.
Particles currently thought to be elementary as of January 2021 include bosons, quarks, and leptons:
### Bosons/Force exchange particles
!!! definition
- **Virtual particles** are bosons that do not have infinite range.
Bosons are particles that carry/exchange forces between particles. The theory of exchange forces posits that all forces are due to particles exchanged between elementary particles. There are four types of bosons that can be roughly categorised by their effect.
**Gluons** ($\pu{g}$) are exchanged for matter to feel **strong nuclear** force: the strongest interaction between particles. These particles are heavy (120 MeV/c<sup>2</sup>) and short-lived, thus giving the force a very short range.
**Photons** ($\pu{\gamma}$) are exchanged for matter to feel **electromagnetic** force: the second strongest force responsible for magnetism and electric force that only act on charged particles. These particles have a rest mass of zero and travel for an infinite distance until they are absorbed.
The **W<sup>+</sup>, W<sup>-</sup>, and Z<sup>0</sup>** bosons are together responsible for the weak nuclear force and are the third strongest force. These particles have a heavy rest mass (80 GeV/c<sup>2</sup> for Ws, 91 GeV/c<sup>2</sup> for Z) and so are even more limited in range than gluons.
**Gravitons** are responsible for gravitational force: the weakest force. These particles are massless and so they have infinite range.
The Higgs field and Higgs boson are responsible for elementary particles obtaining their mass because of magical fields and rainbows.
### Quarks
!!! definition
- A **hadron** is any particle made of quarks.
- A **baryon** is any hadron made of three quarks. An **antibaryon** is any particle made of three antiquarks.
- A **meson** is a hadron made of exactly one quark and one antiquark involved in the **strong** interaction.
- A **fermion** is any particle with mass (hadrons or leptons)
Gluons (strong force) only interact with quarks, which are heavier, more tightly bound elementary particles. There are six quarks with different properties:
| Charge | | | |
| --- | --- | --- | --- |
| $\frac{2}{3}$e | up (u) | charm (c) | top (t) |
| $-\frac{1}{3}$e | down (d) | strange (s) | bottom (b) |
!!! reminder
e is the elementary charge ($\pu{1.6\times10^{-19} C}$).
- All quarks have a **baryon number** of $\frac{1}{3}$.
- All quarks have a **strangeness number** of 0 except for the strange quark, whose number is equal to -1.
- All quarks have their own respective **antiquark**: an antiparticle with opposite charge and baryon number but otherwise identical mass.
- The **quark confinement theory** states that a singular quark cannot be isolated from its hadron.
Every particle has its own **antiparticle** with the same properties but with opposite quantum numbers. In practice, this indicates that mass stays the same while baryon number, lepton number, and charge are opposite. When a corresponding quark and antiquark meet, annihilate each other to become energy. They are denoted by a bar over their letter.
!!! example
An up antiquark (also known as "u-bar") is written as ū.
!!! note
- Protons are composed of two up quarks and one down quark (uud).
- Neutrons are composed of one up quark and two down quarks (udd).
### Leptons
Leptons are lighter and more loosely bound elementary particles compared to quarks. They do not participate in the strong interaction. All leptons have a **lepton generation/family** which is based on their relative mass. A higher mass indicates a higher generation.
| Charge | Generation 1 (L<sub>I</sub>) | Generation 2 (L<sub>II</sub>) | Generation 3 (L<sub>III</sub>) |
| --- | --- | --- | --- |
| -1e | electron (e) | muon (µ) | tau ($\tau$) |
| 0 | electron neutrino ($\pu{v_e}$) | muon neutrino ($\pu{v_\mu}$) | tau neutrino ($\pu{v_\tau}$) |
- All leptons have a **lepton number** of 1.
### Elementary particle interactions
In any interaction, the following are true:
- **charge** is conserved
- the **baryon number** is always conserved
- the **lepton number** of each family is always conserved
- the **strangeness number** is always conserved in *strong and electromagnetic interactions*
!!! example
A lepton number of $\pu{L_{III} = 1}$ on one side becoming $\pu{L_{II} = 1}$ on the other is impossible as lepton family must be kept consistent during interactions.
## Feynman diagrams
A Feynman diagram provides a graphic representation of particle interactions to predict the outcome of a particle collision.
Generally, the time axis is left-to-right but can be specified to be otherwise. The following assumes time moves from left to right.
Fermions are represented by **straight lines with arrows**. Particles have their arrows pointing *forward* in time while antiparticles point backward (even though they still move in the direction of time).
<img src="/resources/images/fermion-feynman.png" width=700>(Source: Kognity)</img>
Bosons/force exchange particles are represented by wiggly lines with no arrow.
<img src="/resources/images/boson-feynman.png" width=700>(Source: Kognity)</img>
Particles only interact at a **vertex** where left refers to the state before the interaction while the right refers to the state afterward. A vertex must have one arrow pointing **toward** and one **away** from the vertex. Conservation laws apply at each vertex.
<img src="/resources/images/vertex-feynman.png" width=700>(Source: Kognity)</img>
Contents of hadrons must be shown. (See the last example for an example.)
### Feynman diagram examples
!!! example
An electron being repelled by another electron due to Coulomb repulsion:
<img src="/resources/images/electron-repulsion.png" width=700>(Source: Kognity)</img>
!!! example
Beta decay:
<img src="/resources/images/beta-decay-feynman.png" width=700>(Source: Kognity)</img>
!!! example
Some weak interaction that violates strangeness:
<img src="/resources/images/weird-feynman.png" width=700>(Source: Kognity)</img>
## Energy sources
!!! definition
- A **primary** energy source is one that is not transformed and used directly by the consumer, such as burning wood for heat.
- A **secondary** energy source is one that is converted from a primary source, such as electricity.
- **Proved reserves** are the resources that are known to be obtainable.
- **Production** are the actual reserves and placed in the market in a certain time interval.
- The **expectancy** of a product is the estimated time its proved reserves will last given its production (proved reserves ÷ production).
- The **specific energy** ($E_{SP}$) of a source is the energy obtained per unit mass of fuel (J/kg).
- The **energy density** ($E_D$) of a source is the energy obtained per unit volume (J/m<sup>3</sup>).
If a fuel source can be replenished with a "reasonable" amount of time — one human generation, or 50100 years — it is considered to be **renewable**. The world still largely uses non-renewable energy sources.
<img src="/resources/images/renewable-energy-pie.png" width=700>(Source: Kognity)</img>
Electricity is the most common secondary energy source due to its convenience and ease of transport.
### Sankey diagrams
Sankey diagrams show the transfer of energy in a system via directed lines proportional to quantity of energy. Arrows pointing away indicate energy **degradation** — losses in energy transformation.
<img src="/resources/images/sankey-diagram.png" width=700>(Source: Kognity)</img>
To minimise electrical losses during transportation, high voltage, low resistance wires with high cross-sectional areas are used to reduce resistance to reduce power loss.
### Power generation
A moving magnetic field produces an electromotive force as alternating current via **induction** and is how the large majority of power generation is handled.
<img src="/resources/images/power-plant-generation.png" width=700>(Source: Kognity)</img>
In a nutshell, a source of thermal energy such as burning fossil fuels is used to boil water whose steam is then used to turn a turbine to generate power before condensing and repeating the cycle.
Coal and oil-powered power plants have efficiencies of around 40% while natural gas is slightly higher at 50% as the gas itself can be used to turn a turbine.
In **nuclear** power plants, the coolant fluid is instead used to turn a turbine.
<img src="/resources/images/nuclear-power-generation.png" width=700>(Source: Kognity)</img>
As only uranium-235 is fissile, but uranium-238 is significantly more common (99.3% U-238 to 0.7% U-235), uranium must first be enriched until the concentration of U-235 is ~3%. **Gaseous diffusion** is a form of enrichment by forming uranium hexafluoride gas and then spinning it in a centrifuge to force separation of U-238 and U-235 based on mass. The energy used in enriching uranium is substantial and should be included in Sankey diagrams.
Moderators are used to encourage fission as they slow down neutrons that are going too fast to fission (most) to a speed more suitable for fission.
### Wind
The kinetic energy of wind can be harnessed to generate power. As convection currents provide the greatest airflow near large bodies of water, wind farms are often constructed there. The wind turns rotor blades which turn a turbine to generate power. It is a source of clean and renewable energy.
Assuming **all wind kinetic energy** is converted to mechanical energy, where $P$ is the power generated, $A$ is the area of the circle that the blades spin around, $\rho$ is the density of the air, and $v$ is the speed of the wind in the direction of the blades:
$$P=\frac{1}{2}A\rho v^3$$
<img src="/resources/images/wind-generator.png" width=700>(Source: Kognity)</img>
| Advantages | Disadvantages |
| --- | --- |
| Renewable | Wind strength is inconsistent |
| Wind is widely available | Turbine blades may kill birds |
| Does not emit greenhouse gases | Many of them are needed to replace one fossil fuel plant, requiring lots of space so they don't interfere with each other |
### Hydro
In hydroelectric plants, a dam is often used to increase the height of a reservoir so that it falls and spins a turbine to generate power. As such, the energy generated is roughly equal to the gravitational potential energy of the water. Where $\Delta h$ is the **average height** of the water from the turbine:
$$E=mg\Delta h$$
<img src="/resources/images/hydro-generator.png" width=700>(Source: Kognity)</img>
During times of lower demand, dams often have a **pumped storage** system that pumps water back into the reservoir for use during higher demand.
### Tidal
A **tidal barrage** generates energy via the kinetic energy of water moving during changes in tide using a multi-directional turbine.
### Photovoltaic
!!! definition
**Intensity** is the power delivered per unit area (watts per square metre).
Photovoltaic (PV) cells are made of silicon doped with phosphorus and boron impurities to convert sunlight directly into electricity. Light from the sun frees electrons in the silicon to produce a current.
<img src="/resources/images/photovoltaic-generation.png" width=700>(Source: Kognity)</img>
The **solar constant** $S$ of $\pu{1.36\times10^3 W/m^2}$ determines the intensity of the sun's light that reaches the Earth. At different latitudes and between seasons, the intensity changes because the Earth is round and is tilted, respectively.
### Solar heating
Instead of converting between multiple forms of energy, solar heating directly converts the sun's energy to heat, increasing efficiency drastically. By using insulation, a black substance, and a glass top, the heat from the sun is trapped and absorbed into water where it is used to heat things.
<img src="/resources/images/solar-heating.png" width=700>(Source: Kognity)</img>
## Thermal energy transfer
!!! definition
- **Radiation** is the transfer of energy via electromagnetic waves emitted away from an object. No medium is needed.
- **Convection** is the transfer of thermal energy via another medium away from an object.
- **Conduction** is the transfer of thermal energy via physical contact.
### Black bodies
!!! definition
**Emissivity** ($e$) is a dimensionless value from 0 to 1 indicating the ability of an object to emit radiation relative to a black body (which has an emissivity of 1). Darker and duller surfaces have an emissivity closer to 1 while shinier and whiter ones are closer to 0.
All bodies with an absolute temperature will emit radiant energy in the form of electromagnetic waves. The temperature of the body determines the wavelengths and power of the radiation emitted. A **perfect emitter** has an emissivity of 1 and is known as a **black body**, absorbing all electromagnetic radiation.
Generally, as the temperature of a body goes down, its peak power density is reduced and its peak wavelength increases.
**Wien's displacement law** relates the temperature of a black body to the waves it emits. Where $\lambda_\text{max}$ is the peak wavelength in metres and $T$ is the temperature of the body in kelvin:
$$\lambda_\text{max}\times T=\pu{2.9\times10^{-3} m\cdot K}$$
The **Stefan-Boltzmann** law relates the specifications of a body to the power it emits. Where $P$ is the power emitted by the body, $A$ is its surface area, $T$ is its temperature, $e$ is its emissivity, and $\sigma$ is the Stefan-Boltzmann constant (equal to $\pu{5.67\times10^{-8} Wm^{-2}K^{-4}}$):
$$P=e\sigma AT^4$$
In problems where the environment temperature is **different** from the temperature of an object, there will be power loss. The net power emitted by a body will be:
$$P_\text{net}=e\sigma A(T_1^4-T_2^4)$$
The solar radiation reaching earth is equal to $\pu{S= 3.9\times10^{26} W}$ with the assumption that it is a black body.
### Albedo
Derived from $I=\frac{P}{A}$, the intensity at a point in space can be related to the power of the radiation emitted by the source ($P$) and the distance between the two ($d$):
$$I=\frac{P}{4\pi d^2}$$
!!! example
The solar constant is derived in this way by substituting $d$ as the distance from the Earth to the sun.
As Earth and most other planetary bodies are not flat disks pointed at the sun, in reality the sun's intensity is reduced to a quarter due to the formula for a sphere. Therefore, the power absorbed/incident to the Earth is equal to, where $S$ is the solar constant:
$$P_\text{in}=(1-\alpha)\frac{S}{4}A$$
**Albedo** ($\alpha$) is the ratio of power from incident rays reflected or scattered to the power absorbed by a body, ranging from 0 to 1. A black body has albedo 0. On average, Earth's albedo is equal to $0.3$ due primarily to the atmosphere but also clouds and ice.
$$\alpha=\frac{\text{energy scattered/reflected}}{\text{energy absorbed}}$$
Greenhouse gases are responsible for remaining increases in temperature. By absorbing and then re-emittng their natural frequencies of electromagnetic radiation (infrared for greenhouse gases), they delay the release of radiation back into space and heat up the atmosphere.
### Radiation absorption by greenhouse gases
All molecules have a natural frequency at which they absorb radiation from the electromagnetic spectrum and **resonate** at. The natural frequency of greenhouse gases is in the infrared region, which is what the Earth re-emits solar radiation as. Therefore, greenhouse gases absorb this radiation and them re-emit it in all directions, "trapping" some of the radiation. Resonance is also the phenomenon responsible for the protection from ultraviolet radiation by the ozone layer.
## Photoelectric effect
**Wave-particle duality** posits that everything can be described as either a particle or a wave, and that all particles will show some wave characteristics and all waves will show some particle characteristics, so really what the hell is happening?
The photoelectric effect is the phenomenon in which electrons are emitted when electromagnetic radiation hits a material. It was theorised that EM radiation travelled in **discrete** energy packets known as **quanta**, which held a defined amount of energy that could not be divided smaller. Where $h$ is Planck's constant, $c$ is the speed of light, and $\lambda$ is the wavelength of the light:
$$E=\frac{hc}{\lambda}$$
!!! example
The application of the photoelectric effect in the real world has led to large advances in technology, such as in **photodiodes** in light sensors — semiconductors where electrons are freed by indicent light to raise the conductivity of the material, and **charged coupled devices** in cameras — the "film" of the modern digital camera.
It was later observed that for a given material, electrons were ejected when light shone on a surface only if the light's energy/frequency was greater than a certain threshold. Below that threshold, electrons were not ejected **regardless** of the intensity of the light.
Electrons have a "binding energy" that hold them to the nucleus of an atom. To release an electron from the nucleus, energy greater than that binding energy must be provided. This binding energy, known as the **work function** $W_0$, is therefore the minimum energy required for a surface to eject electrons.
As such, where $E_k$ is the kinetic energy of the ejected electron, $E_{ph}$ is the energy of the incident photon/radiation, and $W_0$ is the work function of the surface:
$$E_k=E_{ph}-W_0$$
Electrons are ejected and thus the photoelectric effect observed **only** if $E_k>0$. The equation above shows that the kinetic energy of an ejected electron is determined **only** by the wavelength/frequency of the incident radiation and *not* by the intensity of the light.
The intensity of incoming radiation effectively represents the number of photons striking per unit area of a surface, so while it does not affect whether electrons are ejected, it affects the **number** of electrons that are ejected *only if they are determined to be ejected*.
In a light frequency-kinetic energy graph,
- the x-intercept represents the **threshold frequency** $f_0$: the minimum frequency required to liberate electrons at all.
- the y-intercept represents the **work function** $-W_0$: the "binding energy" of the electrons.
### Momentum of photons
It was also observed that during photon-electron collisions that momentum and kinetic energy were conserved, further reinforcing the idea of wave-particle duality of light. Where $h$ is Planck's constant, $f_i$ and $f_f$ are the initial and final frequencies of the light, $m$ is the mass of the electron, and $v_{ei}$ and $v_{ef} are the initial and final velocities of the electron:
$$hf_i+\frac{1}{2}mv^2_{ei}=hf_f + \frac{1}{2}mv^2_{ef}$$
In general, the momentum of a photon is equal to, where $h$ is Planck's constant and $\lambda$ is the wavelength of the light:
$$p=\frac{h}{\lambda}$$
### Matter waves
Particles/waves cannot act like particles and waves at the same time. For a given observation, it adopts the property of one or the other. In reality, all particles exhibit wave properties *sometimes* and all waves exhibit particle properties *sometimes*. Each particle has a wave function that determines how likely it is to be somewhere at any point in time.
By equating the equations for momentum of photons and particles, the (de Broglie) wavelength of a particle can be determined. Where $\lambda$ is the wavelength of the particle, $m$ is its mass, $v$ is its velocity, and $h$ is Planck's constant:
$$\lambda=\frac{h}{mv}$$
Therefore, wavelengths of "particles" are only really significant for small masses at high speeds rather than large masses at lower speeds.
!!! example
A 50 kg mass moving at 16 m/s is has a wavelength many orders of magnitude smaller than a quark and will not display any observable wave behaviours.
The discovery of wave-particle duality has led to advancements in technology such as the scanning electron microscope.
## Special relativity
Einstein's theory of special relativity states that time and space are relative depending on the **frame of reference** of the observer, and light travels at the *same speed* of $\pu{3.0\times10^8 m/s}$ in a vacuum no matter how it is observed in all inertial frame of reference.
- An **inertial** reference frame is one in which the law of inertia in the frame holds true. Only frames of reference moving at a constant velocity or at rest are inertial, and the same laws of physics apply in all inertial frames of reference.
### Time dilation and length contraction
The faster an observer moves, to ensure that it appears to them that light travels at $c$, time slows down for the observer. Observers in inertial frames of reference will experience time at a slower rate — this phenomenon is known as time dilation.
For two **inertial** reference frames, where $t_s$ is the time observed between two events (stationary/**proper** time) at the same location and at rest relative to a stationary observer, $t_m$ is the time observed between two events in a different frame of reference (moving time), $v$ is the speed difference between the frames of reference, and $\gamma$ is the **Lorentz factor**:
$$
\gamma=\frac{1}{\sqrt{1-\frac{v^2}{c^2}}} \\
t_m=\gamma t_s
$$
Space is also relative. An observer moving at a higher constant velocity will have space contract — this phenomenon is known as **length contraction**.
Where $L_s$ is the length/distance measured of an object at the same location and at rest relative to a stationary observer, and $L_m$ is the length/distance from a different reference frame:
$$L_m=\frac{L_s}{\gamma}$$
From different inertial reference points, there can never be agreement on whether events are simultaneous. Because time slows down for an observer moving faster, one event will also appear to happen first.
### Matter-energy equivalence
The total energy of an object in an inertial frame of reference relative to another is related to its velocity and its mass.
$$
E_t=\frac{mc^2}{\sqrt{1-\frac{v^2}{c^2}}} \\
E_k=E_t-E_\text{rest}
$$
At rest, the energy of an object is related to its mass.
$$E_\text{rest}=mc^2$$
## Resources
- [IB Physics Data Booklet](/resources/g11/ib-physics-data-booklet.pdf)
- [IB SL Physics Syllabus](/resources/g11/ib-physics-syllabus.pdf)
- [Dealing with Uncertainties](/resources/g11/physics-uncertainties.pdf)
- [External: IB Physics Notes](https://ibphysics.org)

View File

@ -1,43 +0,0 @@
# Theory of Knowledge
## Knowledge questions and claims
There are two types of knowledge **claims**:
- First-order claims: claims that are made in areas of knowledge or by individual knowers about the world
- Second-order claims: claims that are made about **knowledge** justified using TOK, usually involving an examination of the nature of knowledge
!!! example
- The sky is blue. (first-order)
- Logic is innate. (second-order)
Knowledge **questions** are questions that examine or engage with knowledge claims, such as by including any of the following phrases:
- How can we know that…
- …knowledge…
- How far is it justified…
!!! example
Is our knowledge in mathematics more certain than that of science?
## Knowledge themes and areas
The main areas of knowledge are:
- History
- Human sciences
- Natural sciences
- Mathematics
- Arts
The main themes of knowledge are:
- Knowledge and technology
- Knowledge and language
- Knowledge and politics
- Knowledge and religion
- Knowledge and indigenous studies
## Resources
- [External: TOK 2022](https://tok2022.weebly.com)

View File

@ -1,5 +0,0 @@
# HL History - 2
The course code for this page is **CHY4UZ**.
o7

View File

@ -1,3 +0,0 @@
# HL English - 2
The course code for this page is **ENG4UZ**.

View File

@ -1,9 +0,0 @@
# SL French - 2
The course code for this page is **FSF3UZ**.
o7
## Resources
- [Textbook: Oxford IB French B Course Companion](/resources/g11/textbook-french-b-second-edition.pdf) ([Answers](/resources/g11/textbook-french-b-second-edition-answers.pdf))

View File

@ -1,894 +0,0 @@
# HL Chemistry - 2
The course code for this page is **SCH4UZ**.
## Thermal concepts
!!! definition
- A **system** consists of reactants and products being studied, often represented as a chemical equation.
- The **surroundings**/**environment** are all matter outside of the system capable of absorbing or releasing energy.
- **Open** systems allow **energy and matter** to move in and out of the system.
- **Closed** systems allow only **energy** to move in and out of the system.
- **Isolated** systems do not allow energy or matter to move in and out of the system. This is an ideal but unrealistic scenario.
### Changes
As **breaking bonds requires energy** and **forming bonds releases energy**:
!!! definition
- An **endothermic** reaction overall requires energy.
- An **exothermic** reaction overall releases energy.
**Physical** changes such as state changes or dissolving substances may release or require energy depending on the energy of intermolecular bonds being broken and formed.
!!! example
- Ice melting requires energy to break the stronger bonds in a solid.
- Dissolving salt in water breaks the intermolecular bonds holding the salt together but regains it all by forming new bonds with the water.
**Chemical** changes all involve breaking old bonds to form new bonds. Depending on the energy required/released in breaking/forming those bonds, the reaction may end up endothermic or exothermic. Regardless, all reactions need a small initial **activation energy** to begin.
!!! info
Acid-base reactions are always exothermic.
### Specific heat capacity
Please see [SL Physics 1#3.1 - Thermal concepts](/sph3u7/#31-thermal-concepts) for more information.
## Enthalpy
Represented as $H$ in joules, enthalpy represents the total energy in a system. Absolute enthalpy is not measurable, so change in enthalpy ($\Delta H$) is often used instead. The magnitude of enthalpy change is dependent on the type of change and quantity of substance that is changing.
A **negative** $\Delta H$ indicates that energy has left the system and so is an **exothermic** reaction.
In a balanced chemical equation, change in enthalpy is written to the right after the product.
$$
a + b \to c\ \ \Delta H = x\text{ kJ}
$$
!!! example
Energy is required for the decomposition of water so its enthalpy is positive.
$$\ce{H2O_{(l)} -> H2_{(g)} + 1/2 O2_{(g)}\ \ \Delta H = +280 kJ}$$
$\Delta H$ can also be included in a balanced thermochemical equation as a reactant or product instead of listed at the end. In this case, it is always positive and its sign determines whether it is a reactant or product.
$$
a + b + x\text{ kJ} \to c
$$
!!! example
Using the same formula as in the previous example:
$$\ce{H2O_{(l)} + 285.5 kJ -> H2_{(g)} + 1/2 O2_{(g)}}$$
### (Standard) Molar enthalpy of reaction
The **molar enthalpy of reaction** $\Delta H_x$ expresses the change in enthalpy when exactly one mole of the substance is involved in the reaction.
!!! example
The molar enthalpy of combustion (also known as the **heat of combustion**) of ethanol is $\pu{-1367 kJ/mol}$, indicating that every one mole of ethanol combusted releases 1367 kilojoules of energy.
$\Delta H_\text{combustion} = \ce{-1367 kJ/mol C2H6O}$
The **standard molar enthalpy of reaction** $\Delta H^\theta_x$ is the molar enthalpy of reaction when initial and final conditions of the reaction are at standard atmospheric temperature and pressure (SATP, 25°C @ 100 kPA). Therefore, the activation energy, energy released/required during the reaction, and energy released/required following the reaction to return to SATP are all included.
!!! warning
This includes energy required for some substances to change state, such as water vapour from combustion cooling to 25°C.
### Energy profiles
Also known as **reaction profiles**, energy profiles are a visual representation of the change in chemical potential energy of the system.
- Absolute enthalpy ($H$) is placed on the y-axis while the reaction progress (time, sort of) is placed on the x-axis.
- A horizontal line representing the enthalpy before the change is placed at the beginning labelled with the reactants.
- A horizontal line representing the enthalpy after the change is placed at the end labelled with the products.
- The change in enthalpy is labelled with an arrow in the direction of the change with its value if known.
- A hump shows the reaction in progress (even exothermic reactions require some activation energy).
### Bond enthalpies
$\Delta H_B$, also known as **bond association energies**, the enthalpy of a bond type (e.g., $\ce{C-H}$) is the energy required to break **1 mol** of that bond type when the reactants and products are **gaseous** so energy is not lost from state changes. Compared of other methods of determining reaction enthalpy, this method is less accurate due to the other compounds affecting bond strength and thus enthalpy on a per-molecule basis.
The change in enthalpy of a reaction can be approximated by considering the bonds broken and formed:
$$\Delta H = \sum n\Delta H_B\text{reactants} - \sum n\Delta H_B\text{products}$$
## Calorimetry
!!! definition
- A **calorimeter** measures changes in energy.
A basic calorimeter uses a lid and insulation to keep matter in and minimise energy changes with its surroundings. A thermometer is used to measure the temperature change of the water, and a stirrer is common to ensure accurate thermometer readings. The reactants are placed in water to react.
<img src="/resources/images/basic-calorimeter.png" width=700>(Source: Kognity)</img>
It is assumed that all the heat lost/gained by the reaction is gained/lost from the water.
$$-q_\ce{H2O}=\Delta H_\text{reaction}$$
In the event that reactants cannot be placed in water to react (e.g., combustion), a **bomb calorimeter** is used, which contains a metal sealed box submerged in the waterfilled with reactant and oxygen. A circuit leads into the box to start the reaction with a spark.
!!! warning
Assumptions in calorimetry:
- All energy released/absorbed from the system goes to/from the surroundings of the calorimeter (water). This usually needs to be corrected for in bomb calorimeters by measuring the heat capacity and mass of the metal box inside the calorimeter as well.
- No energy is transferred outside the calorimeter — the insulation should work properly.
- The calorimeter itself does not absorb or release energy — this is not a good assumption but can be compensated for.
- A dilute aqueous solution is assumed to have the same density and specific heat capacity as water — this assumption is best when the solute is diluted close to 1 mol/L.
### Measuring calorimeters
Instead of recording the temperature of the calorimeter at any one point, a range of temperatures over time per trial should be plotted to obtain a curve. As calorimeters are not perfect and absorb/release energy, it will generate a graph that peaks and slowly returns to ambient temperature. To remedy this, the line returning the temperature to normal should be **linearly regressed** and extrapolated to the reaction start time to obtain a more accurate peak temperature.
## Hess's law
Hess's law asserts that the change in enthalpy works like displacement - so long as the products and reactants are the same, any reaction with any number of intermediate steps will result in the same change in enthalpy.
$$\Delta H = \sum \Delta H \text{ of intermediate reactions}$$
### Formation equations
A **formation equation** is a balanced chemical equation where exactly one mole of product and its reactants in **elemental form** are in their standard state — -gens are diatomic, phosphorus is $\ce{P4}$, sulfur is $\ce{S8}$, and at SATP (25°C, 100 kPa).
!!! info
Fractions are permitted as coefficients on the reactant side to get exactly one mole of product.
!!! example
$$\ce{6C_{(s)} + 6H2_{(g)} + 3O2_{(g)} -> C6H12O6}$$
$$\ce{2C_{(s)} + 3/2 H2_{(g)} + 1/2 Cl2_{(g)} -> C2H3Cl_{(g)}}$$
The **standard enthalpy of formation** $\Delta H^\theta_f$ is the energy change from the formation of one mole of its substance from its elements in their standard states. It can be determined by subtracting the sum of the enthalpy of each element/compound on the reactant side and adding those on the product side.
$$\Delta H = \sum n\Delta H\text{ products} - \sum n\Delta H\text{ reactants}$$
!!! warning
It is assumed that there is no state change that would affect enthalpy when calculating *standard* enthalpy of formation.
### Enthalpy cycles
Enthalpy cycles are a visual representation of Hess's law. It is used to show that the energy is the same from initial reactants to a product regardless of any intermediate steps.
!!! example
$\Delta H_1 = \Delta H_2 + \Delta H_3$. Note that both arrows point to the intermediate product.
<img src="/resources/images/enthalpy-cycles.png" width=700>(Source: Kognity)</img>
## Born-Haber cycles
!!! definition
- The **standard enthalpy of atomisation** $\Delta H^\theta_{atm}$ is the energy required to change 1 mol of an element at SATP in its standard state to 1 mol of atoms of that element in its gaseous state.
To form an ionic compound from elements in their standard states:
- the elements must be converted into gaseous atoms, (enthalpy of atomisation)
- the atoms must lose or gain electrons to form ions, (electron affinity/ionisation energy)
- and then the gaseous ions must bond to form an ionic compound.
The products should be listed on each level of a Born-Haber cycle, and relatively to-scale arrows should point in the direction of enthalpy change, where upwards increases enthalpy.
<img src="/resources/images/born-haber-simple.png" width=700>(Source: Kognity)</img>
Second ionisation energy may increase the peak enthalpy after it has lowered from first ionisation energy. In this case, unlike the below figure, the first and second ionisation energies can be combined into a single arrow representing the sum of both.
<img src="/resources/images/born-haber-ionisation.png" width=700>(Source: Kognity)</img>
### Lattice enthalpy
The lattice enthalpy of an ionic compound is the energy required to dissociate 1 mol of an ionic solid to its gaseous ions.
- It decreases as ionic radius increases due to greater distance and charge separation
- It increases as difference in charge increases because the greater charges are more strongly attracted
- The above only apply if the other (ionic radius/charge) is the same or similar
- Difference in charge has a much greater effect than ionic radius as it is multiplicative while the effect of increasing radius is additive
### Enthalpy of solution and hydration
The enthalpy of hydration is the enthalpy change when 1 mol of a gaseous ion is dissolved in water to make an infinitely dilute solution such that it is unaffected by attraction or repulsion from other ions.
!!! example
The enthalpy of $\ce{Na+_{(g)} -> Na+_{(aq)}}$ is the enthalpy of hydration of $\ce{Na+}$.
The enthalpy of solution is the enthalpy change when 1 mol of a substance dissolves in water. It is equal to the sum of the enthalpy of hydration and lattice enthalpy.
$$\Delta H_{sol}=\Delta H_{hy} + \Delta H_{latt}$$
!!! example
The enthalpy change of $\ce{NaCl_{(s)} -> Na+_{(aq)} + Cl-_{(aq)}}$ is the enthalpy of solution of $\ce{NaCl}$.
## Entropy
**Entropy**, $S$, is a measure of structural disorder in a system in $\pu{J/K/mol}$. Absolute enthalpy is always positive, similar to enthalpy. An increase in disorder results in more entropy which results in a greater chance that a system will be in a certain state.
A reaction that increases entropy can continue even in the absence of extra energy, which results in endothermic reactions.
Reactions that would increase entropy are **entropically favoured**, so entropy will work to make it happen.
The following changes increase entropy:
- changes in state of one substance to a more disordered state, i.e., solid → liquid → gas,
- mixing particles of different types, e.g., solid to aqueous,
- increasing the number of moles of total gas or decreasing the number of moles of a solid,
- and increasing the number of moles of gas on the product side compared to the reactant side, which has the greatest effect.
### Spontaneity
The **spontaneity** of a reaction is its tendency to continue without extra energy input after its initial activation energy.
Gibbs free energy or **standard free energy** ($\Delta G$/$\Delta G^\theta$, $\pu{kJ}$ or $\pu{kJ/mol}$) is a measure of the sponetaneity of a chemical change. Spontaneous reactions must have a negative $\Delta G$, while those that are positive will require more energy to continue.
$$\Delta G^\theta = \Delta H^\theta - T\Delta S^\theta$$
## Chemical kinetics
The **rate of a reaction** is the change of reactant to product per unit of time. The following are all viable methods of measuring rate of reaction:
- change in gas volume via gas collection,
- change in mass,
- change in light absorption,
- titration,
- and change in conductivity.
In an ideal gas, the kinetic energy of particles is spread in a **Maxwell-Boltzmann distribution**, where the total area under the curve is equal to the total number of particles in the sample.
<img src="/resources/images/maxwell-boltzmann.png" width=700>(Source: Kognity)</img>
As temperature increases, the distribution's total area *does not change* but the overall spread moves to the right as more particles have higher kinetic energies.
<img src="/resources/images/mbdist-temperature.png" width=700>(Source: Kognity)</img>
### Collision theory
Collision theory states that for a chemical reaction to take place between two particles:
- they must collide,
- they must have proper **collision geometry** or **collision orientation** — similar to viruses bumping into cells, the "keys" must hit "locks" — in this case usually they must strike the bond,
- they must collide with enough energy to break the initial bond.
If all of these conditions are met, the collision is an **effective collision** — a collision that results in a chemical reaction.
The rate of a reaction increases with:
- the frequency of collisions,
- and the proportion of collisions that are effective collisions
Over time, the rate generally decreases because initially the highest concentration of reactants results in the highest collision frequency, which goes down as reactants are consumed. The proportion of effective collisions will also decrease as reactants also collide with product. Eventually, the reaction will stop or be so slow it appears to have stopped.
<img src="/resources/images/change-of-rate-over-time.jpg" width=700>(Source: Kognity)</img>
The following factors affect the rate of reaction:
- **Surface area/particle size of a solid:** as only particles on the surface of a solid can be collided with, smaller solid particles have greater surface area where more collisions can happen, leading to greater collision frequency.
- **Concentration/pressure of reactant**: A greater concentration leads to more reactant particles to collide in a given volume, increasing collision frequency.
- **Temperature**:
- Increasing temperature increases reactant particles' kinetic energy, increasing collision frequency,
- however it primarily increases the chance of particles having sufficient activation when they do collide, changing the proportion of effective collisions.
### Activation energy
Because electron clouds repel reach other, without extra energy, particles would not get close enough to break bonds. This energy required for particles to become closer is known as the **activation energy** of a reaction. All chemical reactions have an activation energy requirement.
### Catalysts
A catalyst is a substance that increases the rate of a reaction without being consumed. Not all reactions have catalysts, and increasing catalyst quantity does not necessarily always increase the rate of reaction.
Catalysts operate by reducing the activation energy needed by creating an **alternative reaction pathway** with a lower activation energy, so a larger proportion of particles are able to reach that lower energy requirement.
<img src="/resources/images/catalyst-energy.png" width=700>(Source: Kognity)</img>
Visualised with a Maxwell-Boltzmann distribution:
<img src="/resources/images/mbdist-catalyst.png" width=700>(Source: Kognity)</img>
Catalysts can also improve the chances of correct collision geometry by encouraging certain orientations.
## Rates of reaction
The **law of mass action** states that the rate of any reaction is directly proportional to the product of each reactant **concentration**. For a reaction of the form $\ce{aA + bB -> products}$, the rate law holds that:
$$r=k[A]^a [B]^b$$
where $k$ is the **rate constant**, an empirically determined value that is only valid for one reaction at one temperature. Its units are equal to whatever balances out the equation — where $n$ is the order of reaction, it is equal to $\ce{dm^{3(n-1)}} / \pu{mol}^{n-1} / \pu{s}$.
!!! warning
Solids and liquids have constant concentrations, so their factor is incorporated as part of $k$ and **not included** as a separate factor (e.g., not as $[C]^c$).
The **individual order of reaction** is the value of the exponent of a specific reactant in the rate law. It must be a real positive number.
!!! example
The individual order of the reaction with respect to $A$ is $a$, and the order of reaction is $a+b$.
To determine the individual order of reaction of a reactant, two identical experiments with equal quantities of the **other** reactants are needed. Where $c$ is the concentration of the reactant between the two trials, $r$ is the rate, and $n$ is the individual order of that reactant:
$$\biggr(\frac{c_2}{c_1}\biggr)^n = \frac{r_2}{r_1}$$
!!! example
For the following data, changing the concentration of $\ce{OCl-}$ by a factor of 3 causes a rate change by a factor of 9, therefore the individual order of $\ce{OCl-}$ is 2.
| Initial $\ce{[OCl-]}$ | Initial $\ce{[I-]}$ | Initial rate |
| --- | --- | --- |
| $1.0\times10^{-3}$ | $4.0\times10^{-3}$ | $1.0\times10^{-3}$ |
| $3.0\times10^{-3}$ | $4.0\times10^{-3}$ | $9.0\times10^{-3}$ |
### Integrated rate laws
Throughout the course of one trial of one reaction, a **concentration-time graph** can be used to find details about its rate. Where concentration is the concentration of the reactant in question over time:
<img src="/resources/images/concentration-time.png" width=700>(Source: Kognity)</img>
A reactant with an individual order of
- **zero** shows a negative linear line, and $k=-\text{slope}$.
- **one** shows exponential decay, and $k=-\text{slope}$ of a graph of $\ln(\text{concentration})$ against time, which should be linear.
- **two** shows a *deeper* exponential decay, and $k=\text{slope}$ of a graph of $\frac{1}{\text{concentration}}$ against time, which should be linear.
Additionally, a **concentration-rate graph** can be used.
<img src="/resources/images/concentration-rate.png" width=700>(Source: Kognity)</img>
A reactant with an individual order of
- **zero** shows a horizontal line.
- **one** shows a positive linear line that passes through the origin.
- **two** shows the right side of a positive quadratic that passes through the origin.
### Half-life
The half-life ($t_{1/2}$) of a reaction represents the time required for half of the sample to be used.
In the context of radiation, it is the time for half of the nuclei in a radioactive sample to decay.
In a **zero-order** reaction, each half-life is half of the previous.
In a **first-order** reaction, it is constant regardless of concentration, and can the concentration can be expressed with an equation, where $[A]$ is the concentration of a wanted substance, $k$ is the rate constant, and $[A_0]$ is the initial concentration.
$$\ln[A]=\ln[A_0]-kt_{1/2}$$
In a **second-order** reaction, each half-life is double the previous.
### Reaction mechanisms
!!! definition
- A **multi-step reaction** consists of more than one reaction as intermediate steps.
- An **elementary step** is the basic step of a multi-step reaction, usually involving one or two molecules but never more than three.
- A **reactant** is present initially but not at the end of a reaction unless in excess.
- A **product** is not present initially but appears at the end of a reaction.
- A **catalyst** is present both at the start and end of a reaction. It may be consumed and regenerated in intermediate steps.
- A **reaction intermediate** is not present at the start or end of a reaction as it is generated and consumed in the intermediate steps.
- The **molecularity** of a reaction represents the number of molecules that react in an elementary reaction from uni- to termolecular.
- An **activated complex** or **transition state** is the point where new bonds are being formed at the same time bonds are being broken.
A reaction involving any more than three particles will always take place under **multiple steps** because of the near-impossibility of such a perfect collision. Even reactions with three particles are often **multi-step**.
The **reaction mechanism** is the step-by-step sequence of all elementary steps of a reaction. An elementary step that is repeated consecutively should be surrounded with square brackets and a coefficient.
!!! example
$$\ce{2\times\big[HOBr + HBr -> Br2 + H2O\big]}$$
!!! example
The reaction $\ce{NO2_{(g)} + CO_{(g)} -> NO_{(g)} + CO2_{(g)}}$ has a theoretical reaction mechanism of:
$$
\begin{align*}
\ce{
NO2_{(g)} + NO2_{(g)} &-> NO3_{(g)} + NO_{(g)} \\
NO3_{(g)} + CO_{(g)} &-> NO2_{(g)} + CO2_{(g)}
}
\end{align*}
$$
$\ce{NO3_{(g)}}$ is a reaction intermediate.
Multi-step reactions will have a **rate-determining step**, which is the slowest step and so is responsible for the rate law of the reaction, acting as a bottleneck. If reaction intermediates are present, the **original** reactants or catalysts that form that intermediate are still used in the rate law.
!!! example
The reaction $\ce{H2_{(g)} + Q2_{(g)} + 2Z2_{(g)} -> 2HZ_{(g)} + 2QZ_{(g)}}$ has the following reaction mechanism:
$$
\begin{align*}
\ce{
H2_{(g)} + Q2_{(g)} &-> 2HQ_{(g)} \\
2\times\big[HQ_{(g)} + Z2_{(g)} &-> HZ_{(g)} + QZ_{(g)}\big]\ \text{ (slow)}
}
\end{align*}
$$
As normally for this reaction $\ce{r=k[HQ][Z2]}$, because $\ce{HQ}$ is a reaction intermediate, it is instead $\ce{r=k[H2][Q2][Z2]}$ after substituting in the first step, **ignoring product coefficients**.
Often, the step with the highest activation energy is the slowest because of collision theory. Alternatively, the one with the least favourable collision geometry, such as if there are more particles that have to collide, may be the slowest.
If a reactant doesn't appear in the rate-limiting step (including via intermediates), changing its concentration will not affect the rate of reaction and so it will have an individual order of 0 in the final rate law.
A reaction mechanism is only plausible if:
- each elementary reaction has **three** or less reactant particles,
- the rate-determining step is consistent with the rate law provided, and
- the elementary steps add up to the overall equation.
### Arrhenius equation
The Arrhenius equation relates the temperature to the rate of a reaction.
Where:
- $k$ is the rate constant,
- $R$ is the ideal gas constant,
- $E_a$ is the activation energy for the reaction,
- $A$ is the proportionality/Arrhenius constant for the reaction,
- and $e$ is Euler's number
$$k=Ae^\frac{-E_a}{RT}$$
Graphing $\ln k$ against $\frac{1}{T}$ forms the linear relation:
$$\ln k = \frac{-E_a}{R}\frac{1}{T}+\ln A$$
where the slope of the graph is $\frac{-E_a}{R}$ and the y-intercept is $\ln A$.
The number of moles of gas particles that are above the activation energy threshold is expressed in the second term of the equation: $e^\frac{-E_a}{RT}$.
## Equilibrium
!!! definition
- A reaction is at **dynamic equilibrium** if both the forward and reverse reaction continue at **equal and constant** rates, and there are no **macroscopic** changes such as temperature, colour, mass, or concentration.
A chemical equation at equilibrium is represented with two single-headed arrows, indicating that a reaction has proceeded to the point that concentrations are constant, and rates are equal and constant.
$$\ce{A + B <=> C}$$
<img src="/resources/images/equilibrium-rate.png" width=700>(Source: Kognity)</img>
In order for a system to eventually tend to equilibrium, the system must:
- be closed, with constant concentrations of reactant and product,
- maintain a constant temperature, and
- maintain a constant pressure if the reactant or product is a gas.
For a given reaction, as long as the reactants and products are stoichiometrically matched, any combination will tend to the same equilibrium.
!!! example
The following initital concentrations for the reaction $\ce{C + O2 -> CO2}$ will all tend to the same equilibrium.
- 2 mol $\ce{C}$ and 2 mol $\ce{O2}$
- 2 mol $\ce{CO2}$
- 1 mol $\ce{C}$, 1 mol $\ce{O2}$, and 1 mol $\ce{CO2}$
At equilibrium, the concentrations of the reactants and products must end up constant (but **not necessarily equal**).
!!! example
<img src="/resources/images/equilibrium-concentration.jpeg" width=700>(Source: Kognity)</img>
**Phase equilibrium** is when two or more states of exactly one pure substance are in dynamic equilibrium.
!!! warning
A solution or an aqueous compound cannot be in phase equilibrium because it is not a pure substance.
!!! example
Water constantly evaporates and condenses. Because the rate of evaporation is only dependent on the surface area of the water, the rate of condensation increases until the two are equal and constant at phase equilibrium.
A **solubility equilibrium** requires at least two substances — a solute and a solvent.
### Equilibrium constant
!!! definition
- The **position of equilibrium** is the concentration of reactants and products at dynamic equilibrium.
The equilibrium constant $K_c$ or $K_eq$ is related to the concentration of reactants and products in a given system at equilibrium at a given temperature. It is equal to the product of all products divided by the product of all reactants.
$$
\ce{aA + bB + cC <=> fF + gG + hH} \\
\begin{align*}
K_c &= \ce{\frac{[F]^f [G]^g [H]^h}{[A]^a [B]^b [C]^c}} \\
&= \frac{\Pi[\text{products}]^p}{\Pi[\text{reactants}]^r}
\end{align*}
$$
The units of $K_c$ varies similar to the rate constant so they are often omitted.
!!! warning
Only concentrations that change during the course of the reaction should appear in $K_c$, so solids and liquid water should not be included.
If $K_c$ is greater than 1000, the reaction is **product-favoured**, meaning that there will be a greater concentration of products at equilibrium. If $K_c$ is less than 0.001, the reaction is **reactant-favoured**.
Contrary to the house of cards of lies told to you in lower grades, all reactions are equilibrium reactions, but some have $K_c$s that are so large or small that they effectively occur to completion or don't occur at all.
#### ICE tables
An initial-change-equilibrium (ICE) table is used to work with equilibrium concentrations and **only contains concentrations**.
It consists of:
- the original concentrations of each compound in the "initial" row,
- the change in concentration in the form of a variable of each compound after one "iteration" of the reaction in the "change" row, and
- the end equilibrium concentration of each compound in the "equilibrium" row. The "initial" and "change" rows should sum to the "equilibrium" row.
!!! example
An ICE table with 1 mole each of $\ce{H2}$ and $\ce{I2}$ in $\pu{2.00 dm3}$ of water that eventually ends up with an equilibrium concentration of $\ce{[H2]}=\pu{0.11 mol/dm3}$ will form the following ICE table.
| | $\ce{H2_{(g)}}$ | $\ce{I2_{(g)}}$ | $\ce{2HI_{(g)}}$ |
| --- | --- | --- | --- |
| Initial | 0.50 | 0.50 | 0 |
| Change | $-y$ | $-y$ | $+2y$ |
| Equilibrium | 0.11 | 0.50$-y$ | $+2y$ |
When working with values involving $K_c$, if the initial concentration of a chemical is much bigger than $K_c$ ($[A]/K_c > 500$), it is possible to assume that it will not change at all.
This assumption is valid if the impact of the calculated shift is less than 5%.
!!! example
If the equilibrium concenration is equal to $0.250-2y$, and the initial concentration is very big, assume that the equilibrium concentration is $0.250$, removing the $-2y$ from the equation.
As long as $2y$ is less than 5% of 0.250, the assumption is valid.
!!! info
In this course, when working with $K_c$ and ICE tables, only three things should be possible when solving for concentrations: you can get a perfect square, you can use the quadratic equation, or you can use the approximation rule.
### Le Chatelier's principle
Le Chatelier's principle states that: If there is a change in a system at equilibrium, the position of equilibrium will readjust to minimise the effect of the change.
The changes that this principle affects — and therefore affect equilibrium — include changes in temperature, concentration, and pressure. These changes are assumed to occur instantaneously, which may result in sudden theoretical spikes in concentration-time graphs.
The initial rate of the change will start **fast** and then slow down, appearing as a sharp change instead into a curve in a concentration-time/reaction progress graph that **never return to its original value**.
!!! tip
Drawing horizontal dotted lines that represent the original position of equilibrium and vertical lines to represent the moment of system change makes it clearer to read.
Increasing the **temperature** of a system causes it to shift in favour of the **endothermic** side, and vice versa.
Of the three changes, this is the only one that would change $K_c$ as it changes the rate constants, which are temperature-specific ($K_c\propto\frac{r_\text{reverse}}{r_\text{forward}}$). Therefore, as temperature **increases**, $K_c$ also **increases**, and vice versa.
!!! example
If heat is added to a solution of KCl, more KCl will dissolve to minimise the change in temperature as it is an endothermic process.
Increasing the **concentration** of a reactant or product will cause the position to shift **away** from the increased side, and vice versa.
??? example
If there is an **instantaneous** spike of $\ce{N2}$ to a system at equilibrium, it will be consumed along with $\ce{H2}$ to form $\ce{NH3}$, **but not enough to return to its original value**.
<img src="/resources/images/equilibrium-concentration.png" width=500>(Source: Kognity)</img>
The same applies if instead $\ce{NH3}$ is reduced.
<img src="/resources/images/equilibrium-concentration-2.png" width=500>(Source: Kognity)</img>
Increasing the **pressure** of a gas will cause the position to shift in whatever direction would **decrease** the total moles of gas.
!!! warning
Inert (uninvolved in a reaction) gases such as catalysts will not affect the position of equilibrium as it does not affect the **partial pressure** of the gas. In a similar vein, adding water to an aqueous solution will not cause any changes in equilibrium position.
!!! warning
If given a system not at equilibrium, if a change is made that would change the prior equilibrium, it should be assumed that the system reaches equilibrium before the change is made, regardless if it is specified.
### Gibbs free energy 2
The value of Gibbs free energy changes as the reaction progresses, similar to enthalpy. At equilibrium, $\Delta G=0$, so a reaction is a result of a system attempting to minimise Gibbs free energy.
**Standard Gibbs free energy** represents the Gibbs free energy of a chemical at standard state (1 mol/L for solutions, 100 kPa partial pressure for gases).
$$\Delta G^\circ = \sum n\Delta G^\circ_\text{f products} - \sum n\Delta G^\circ_\text{f reactants}$$
A negative $\Delta G^\circ$ indicates that the reaction will shift right to reach equilibrium as $\Delta G^\circ$ always decreases in **magnitude** as the reaction proceeds. It also means that the forward reaction is **spontaneous** while the backwards is not.
### Reaction quotient
The reaction quotient ($Q$) is a tool to compare the current state of a system to its equilibrium state.
$$Q=\frac{\Pi[\text{products currently}]^p}{\Pi[\text{reactants currently}]^r}$$
At equilibrium, $Q=K_c$ as they are the same equation, so the equilibrium will shift in whatever direction that would bring $Q$ closer to $K_c$
!!! example
If $Q > K_c$, there are more products than reactants than at equilibrium, so the reaction will shift to make more **reactants**.
### Dynamic equilibrium
When $\Delta G$ is at a minimum, both sides of the reaction are equally spontaneous. Realistically, $\Delta G$ never reaches zero because entropy. TODO: wtf
<img src="/resources/images/product-favoured-gibbs.png" width=700>(Source: Kognity)</img>
Where $\Delta G$ is the Gibbs free energy at a given point of the reaction, $R$ is the gas constant, $T$ is the current temperature, and $Q$ is the reactant quotient:
$$\Delta G = \Delta G^\circ + RT\ln Q$$
Therefore, at equilibrium:
$\Delta G = -RT\ln K_c$
## Acids and bases
!!! definition
- An **amphoteric** chemical may act as an acid or base depending on the situation.
- An **amphiprotic** chemical can **either accept or donate** $\ce{H+}$ depending on the situation.
- A **monoprotic** acid/base is one that can only accept/ionise one $\ce{H+}$ ion.
- An **alkali/alkaline** solution is an aqueous solution of a base, which may **not** necessarily be a **basic solution**.
An **acid** and **base** are any two corrosive chemicals that react to form water and a salt. They also dissociate/ionise (depending on theory) in water to form electrolytes that conduct electricity.
Acids:
- taste sour
- have a pH less than 7 in aqueous solutions at 25°C
- stain litmus paper **red**
- react with active metals to produce $\ce{H2_{(g)}}$ based on the activity series
- react with carbonates to form $\ce{CO2 + H2O}$
Bases:
- taste bitter
- have a pH greater than 7 in aqueous solutions at 25°C
- feel slippery as they react with fats/oils to form soap
- stain litmus paper **blue**
- react with ammonium salts to product $\ce{NH3 + H2O}$
### Arrhenius theory
An acid **dissociates** in water to produce $\ce{H+}$ ions (protons).
A base **dissociates** in water to produce $\ce{OH-}$ ions.
### Bronsted-Lowry theory
The Bronsted-Lowry theory focuses on reactions with water and less the acid and base ions themselves, so they **ionise** instead of **dissociate**.
An acid is any compound that can **donate/ionise a proton ($\ce{H+}$) to water** to form a hydronium ion.
$$\ce{acid + H2O -> acid- + H3O+}$$
!!! info
In practice, the acid must contain a hydrogen atom attached by an easy-to-break bond (usually $\ce{H-O}$), but any high electronegativity difference polar bond would work as well.
A base is any compound capable of **accepting/removing a proton ($\ce{H+}$) from an acid**.
$$\ce{acid + base -> acid- + base+}$$
!!! info
The proton usually comes from water. The base must be able to accept an $\ce{H+}$ ion to form a **dative covalent bond**, so they must contain **lone pairs**.
Polyprotic acids ionise their $\ce{H+}$s one by one **sequentially**.
!!! example
$\ce{
H3PO4 + H2O <=> H2PO4- + H3O+ \\
H2PO4- + H2O <=> HPO4^2- + H3O+ \\
HPO4^2- + H2O <=> PO4^3- + H3O+
}$
#### Conjugate acids/bases
The result of a base obtaining a proton is a **conjugate acid**.
The result of an acid losing a proton is a **conjugate base**.
!!! example
In the reaction
$$\ce{NH3 + H2O -> NH4+ + OH-}$$
$\ce{NH3}$ is a base that becomes a conjugate acid while $\ce{H2O}$ is an acid that becomes a conjugate base.
### Louis theory
A Lewis **acid** is any species that **accepts** an electron pair to form a dative covalent bond.
A Lewis **base** is any species that **donates** an electron pair to form a dative covalent bond.
### Strong/weak acids/bases
**Strong** acids/bases will **completely** dissociate/ionise in an aqueous solution. This means that the initial concentration of acid will be equal to the end concentration of $\ce{H+ or H3O+}$.
All strong polyprotic acids initially have a one-way reaction then follow with equilibrium reactions.
!!! warning
Strength is a property of an acid and has nothing to do with its concentration.
**Weak** acids/bases will only **partially** dissociate/ionise in an aqueous solution, leaving behind most of the initial acid ($\ce{[acid] > [H+]}$ at equilibrium).
!!! warning
Measuring pH only returns $\ce{[H+] or [H3O+]}$, so it cannot be used to determine the concentration, identity, or strength of an acid.
All weak polyprotic acid reactions are equilibrium reactions.
!!! example
The following is a list of strong and weak acids:
| Strong acid | Weak acid | Strong base | Weak base |
| --- | --- | --- | --- |
| $\ce{HClO4}$ | any $\ce{COOH}$ | $\ce{LiOH}$ | $\ce{NH3}$ |
| $\ce{HCl}$ | $\ce{CO2}$ | any $\ce{group\ 1 + OH}$ | $\ce{Al(OH)3}$ |
| $\ce{HBr}$ | $\ce{SO2}$ | any $\ce{group\ 2 + (OH)2}$ | |
| $\ce{HI}$ | $\ce{HF}$ | | |
| $\ce{H2SO4}$ | $\ce{HCN}$ | | |
| $\ce{HNO3}$ | $\ce{H3PO4}$ | | |
To experimentally distinguish between a strong or weak acid/base, if their concentrations are equal, total **ion** concentration or $\ce{H3O+}$ concentration can be compared since the stronger acid ionises more.
Practically, this means comparing the rate of reaction with a metal or water or measuring conductivity as they reflect total ion count.
### pH and pOH
This section will assume Bronsted-Lowry theory.
pH represents $\ce{[H3O+]}$ logarithmically on a scale from 0 to 14.
$$
\ce{pH = -\log\big[H3O+_{(aq)}\big]} \\
\ce{pOH = -\log\big[OH-_{(aq)}\big]}
$$
!!! warning
The number of sigfigs in pH is equal to the number of digits **after the decimal place**.
A solution is **neutral** (neither acidic nor basic) when $\ce{[H3O+] = [OH-]}$. This happens to be $\ce{pH = 7}$ at SATP. In pure water, this is true as a small number of water molecules react with each other.
In an equilibrium reaction between an acid and a base, $\ce{K_c = \frac{[H3O+][OH-]}{[H2O]}}$, but water has a constant concentration, so the equilibrium of the two ions is represented with the **water ionisation constant** $K_w$ is used.
$$K_w = \ce{[H3O+][OH-] = 1.00\times10^{-14} @ SATP}$$
As temperature **increases**, $K_w$ increases, therefore changing the pH of neutrality, but this may not necessarily change the acidity of the solution as the ion concentration is still the same.
As pH increases, $\ce{[H3O+]}$ decreases, so $\ce{[OH-]}$ must increase to keep $K_w$ constant and maintain equilibrium.
$$\ce{pK_w = pH + pOH}$$
At 25°C, $\ce{pK_w = 14.0000}$, so:
$$\ce{14 = pH + pOH}$$
### Acid/base dissociation
An equilibrium will be reached when a weak acid or base dissociates/ionises in water. The extent that the acid or base has dissociated/ionised can be quantified with **percent dissociation/ionisation**.
$$\text{\% ionisation} = \frac{\text{[acid ionised]}}{\text{[original acid]}}\times 100\%$$
!!! note
When performing an approximation assumption in an ICE table, the assumption is also valid if the % ionisation is less than 5%.
The $K_c$ of acid ionisation/dissociation is known as $K_a$, the **acid dissociation constant**.
$$
\ce{H2O_{(l)} + HX_{(aq)} <=> H3O+_{(aq)} + X-_{(aq)}}$$
$$K_a = \ce{\frac{[X-][H3O+]}{[HX]}}$$
The $K_c$ of base ionisation/dissociation is known as $K_b$, the **base dissociation constant**.
$$\ce{H2O_{(l)} + X_{(aq)} <=> OH-_{(aq)} + HX+_{(aq)}}$$
$$K_b = \ce{\frac{[HX+][OH-]}{[X]}}$$
!!! example
$$\ce{NH3_{(aq)} + H2O_{(l)} <=> NH4+_{(aq)} + OH-_{(aq)}}$$
$$K_b = \ce{\frac{[NH4+] [OH-]}{[NH3]}}$$
!!! warning
$K_a$ and $K_b$ only apply to acids and bases, respectively. Morphine, a base, does not have a $K_a$, but its conjugate acid does.
At all temperatures:
$$K_a \times K_b = K_w$$
$$pK_a + pK_b = pK_w$$
### Acid strength
A **higher** $K_a$ or $K_b$ indicates that the acid or base is **stronger**, increasing percent ionisation.
**Strong acids/bases** have an effectively infinite $K_a$/$K_b$ in water, so they are all practically equally strong in water (this may not be true in other solvents).
As $K_a$ and $K_b$ are inversely correlated, an **increase** in $K_a$ leads to a **decrease** in $K_b$.
The conjugate acid/base of a **strong** acid/base is effectively infinitely weak such that it does not affect pH at all.
Contrarily, the conjugate of a **weak** acid/base is measurably weak, strong enough to have $K_a$/$K_b$ that affect the pH and act as an acid or base.
As $p$ indicates negative log, $\ce{pK_{\{a, b\}}}$ is **inversely** correlated with $\ce{K_{\{a, b\}}}$ so that none of the variables can be directly compared without conversion.
### Acidity of salt solutions
!!! definition
- A **salt** is an ionic compound that dissociates in water.
The pH of a salt solution depends on the combination of the acidity of each of its dissociated ions. Whichever is **stronger** pushes the acidity of a solution in its direction.
An ion originating from a **strong** acid/base is immeasurably weak and **has no effect**.
An ion originating from a **weak** acid/base is measurably weak and **has an effect**.
!!! example
For the salt NaCl: $\ce{HCl_{(aq)} + NaOH_{(aq)} -> H2O_{(l)} + NaCl_{(aq)}}$
As both $\ce{HCl}$ and $\ce{NaOH}$ are strong, their conjugate acids/bases are both immeasurably weak, having no effect on the pH of the solution. Therefore, NaCl is a **neutral** salt.
If both dissociated ions have a measurable effect, the acidity depends on whichever is stronger via $K_a$/$K_b$.
### Titration curves
!!! definition
- A **titrant** or **standard** is a solution with known properties that goes in the burette.
- A **sample** or **analyte** is a solution with potentially unknown properties that goes in the sample flask.
- The **equivalence point** of a titration is the point at which the solution is neutral $\ce{[H+] = [OH-]}$.
A **titration curve** is generated in a titration where the pH of the solution is graphed against the volume of titrant added. Depending on the type or strength of the sample and titrant, different graphs can be generated.
Unlike the diagrams below, in a sketch, the following information is needed:
- the initial pH of the solution (the pH of the sample)
- the pH after a lot of titrant is added (assumed to be the pH of the titrant)
- the volume of titrant required to neutralise the sample ($c_\ce{H}v_\ce{H}=c_\ce{OH}v_\ce{OH}$)
- the relative pH at the equivalence point (the relative pH of the salt solution)
The graph can be split into two halves: the acid half and the base half. In the following diagram, both the acid and base are **strong**, so their lines are identically shaped:
- the line starts at the initial pH, hugging the line, until,
- it sharply curves to the vertical, crossing the equivalence point, and
- continues vertically.
The same applies to the base but it instead ends at the final pH.
<img src="/resources/images/s-s-titration.png" width=700>(Source: Kognity)</img>
In scenarios where the **sample** is a **weak** acid/base, instead:
- the line immediately briefly rapidly rises from the initial pH, then
- gradually increases, until
- a sudden curve to the vertical (but less sudden than a strong acid/base), and
- continues vertically.
<img src="/resources/images/w-s-titration.png" width=700>(Source: Kognity)</img>
In scenarios where the **titrant** is a **weak** acid/base, it will take much more titrant to bring the pH of the sample to the level of the titrant. As such, the "brief rapid rise" is ignored and the line only gradually approaches but **clearly does not reach** the final pH.
<img src="/resources/images/s-w-titration.png" width=700>(Source: Kognity)</img>
In scenarios where the sample is a **polyprotic** acid/base, as its ions dissociate sequentially, it can be treated as multiple consecutive titrations where the first sample is **strong** but any subsequent titrations are **weak**.
Each equivalent point volume after the first is a direct multiple of that first equivalent point volume.
<img src="/resources/images/polyprotic-titration.png" width=700>(Source: Kognity)</img>
### Titration curve analysis
The **aha!** equation, also known as the Henderson-Hasselbach equation, is derived from the equilibrium equation.
$$\ce{pH = pK_a + \log\frac{[A-]}{[HA]}}$$
To graphically determine the $pK_a$ of a sample given a titration curve, the pH at the volume at **half** of the equivalence point can be identified. At that point, $pH = pK_a$.
!!! warning
- If a weak **base** is the sample, this will return the $pK_a$ of the conjugate acid. The pH of the base can be determined by $14-pK_a$.
- If numbers are not given, drawing a line through the straight bits can give pH and equivalence volume values. However, **none** of these lines should be **parallel** to the axes.
- In titrations involving **polyprotic** compounds, as they are effectively multiple titrations, half of the equivalence point is actually half the distance between two equivalence points.
- This equation can **also be used to determine the pH of a buffer between a salt/acid and acid/base** as it can be assumed that there is no change to concentrations, but **cannot be used to determine the initial pH between an acid/base and water**.
### pH indicators
A pH indicator is a **weak acid/base** that is at one colour in a certain pH range and another in another pH range. Where $X$ is the indicator, it will form an equilibrium with the hydrogen ions in the solution:
$$\ce{HX <=> H+ + X-}$$
The indicator is **protonated** on the left and **deprotonated** on the right. The titrant can be viewed as an external stress on this equilibrium: if a base is added to an acid, the equilibrium will shift to the right to free up hydrogen ions, and vice versa.
If the difference in concentration of $\ce{X-}$ and $\ce{HX}$ is **greater than** approximately 10:1, the solution will appear to be the colour of the higher concentration, meaning that pH indicators will change colour at a pH in the range of their $\ce{pK_a}\pm 1$.
In choosing a good pH indicator, it must change colour in the **vertical** section of the titration curve to see the greatest effect, and it must be easily observable.
As the weak curve has less of a vertical section than a strong curve, it is best to pick an indicator that changes **after** the equivalence point, which will require the **relative pH** at the equivalence point.
The observability of an indicator depends on the colour it is changing to (or the **direction** the pH is changing). In general, humans are much better at noticing the **appearance** of **red** and **blue**.
A **universal indicator** is a mixture of different pH indicators to change colours multiple times over the pH range. In this case, the colour wheel can used to determine the colour that will be formed (e.g., blue + blue + yellow = green). The shade of the colour does not matter.
### Buffers
!!! definition
- A **buffer solution** is one that can resist pH change when small quantities of a strong acid or base are added.
- An **acidic buffer** is one where an acid and extra of its conjugate base as a salt are present in the solution.
- A **basic buffer** is one where a base and extra of its conjugate acid as a salt are present in the solution.
- A **protonated** compound contains its proton.
- A **deprotonated** compound has lost its proton.
- The **buffering capacity** of a buffer is the quantity of strong titrant that can be added to the buffer without a significant change in pH.
The **buffer region** is the pH range of a **weak** acid/base before the equivalence point that requires a large volume of titrant for a gradual pH change. In this region, there is sufficient undissociated acid/base to replenish those neutralised via Le Chatelier's principle.
In the equilibrium between a weak acid and its component ions:
$$\ce{HA <=> H+ + A-}$$
A buffer solution is created when **excess** $\ce{A-}$ is added (the salt of the conjugate base) such that the position of equilibrium is shifted to the left to the point that **none of the original acid has dissociated** such that $\ce{[equilibrium HA] = [added HA]}$ and $\ce{[equilibrium A-] = [added A-]}$. It is used to **maintain** a certain pH in a solution.
When the titrant is added to an **acidic buffer**:
- if an acid is added, $\ce{[H+]}$ increases, shifting the position to the left. This can be done repeatedly because of the excess $\ce{A-}$ present to react with the protons.
- if a base is added, $\ce{[H+]}$ decreases as they react, shifting the position to the right. This can be done repeatedly because of the excess $\ce{HA}$ from the original shift to the left from the salt addition.
!!! example
To form the **acetic acid/acetate buffer** $\ce{CH3COOH <=> H+ + CH3COO-}$, if 1 mol/L $\ce{CH3COONa}$ is added to 0.1 mol/L $\ce{CH3COOH}$:
The addition of $\ce{CH3COO-}$ will shift the position to the left, protonating it such that there will be 0.1 mol/L $\ce{CH3COOH}$ and 1 mol/L $\ce{CH3COO-}$.
- If an acid is added, it will **shift left** and further react to form more $\ce{CH3COOH}$, reducing the change in pH.
- If a base is added, it will **shift right** by reacting with hydrogen ions to reduce their concentration, releasing more $\ce{H+ + CH3COO-}$ to replenish the lost hydrogen ions, reducing the change in pH.
This naturally occurs without a buffer, but a buffer significantly increases the quantity of titrant that can be added before the pH changes rapidly.
The same applies to a **basic buffer** but in opposite directions. The salt of the conjugate acid is used instead.
$$\ce{B + H2O <=> HB + OH-}$$
!!! example
To form the **ammonia/ammonium buffer** $\ce{NH3 + H2O <=> NH4+ + OH-}$, if 1 mol/L $\ce{NH4+}$ is added to 0.1 mol/L $\ce{NH3}$:
The addition of $\ce{NH4+}$ will shift the position to the left, deprotonating it such that there will be 0.1 mol/L $\ce{NH3}$ and 1 mol/L $\ce{NH4+}$.
- If an acid is added, it will **shift right** by reacting with hydroxide ions to reduce their concentration, releasing more $\ce{NH4+ + OH-}$ to replenish the lost hydroxide ions, reducing the change in pH.
- If a base is added, it will **shift left** and further react to form more $\ce{NH3 + H2O}$, reducing the change in pH.
To make an effective buffer, salt of the conjugate base/the conjugate acid is required to initially shift the position left. Adding more salt/acid increases the titrant that can be buffered.
A buffer only acts over a certain pH. In order for it to be effective, the ratio of $\ce{[A-]}$ to $\ce{[HA]}$ must be within 10x or 0.1x, although usually buffers are made with 90% excess salt/acid + 10% acid/base or vice versa. Using the **aha!** equation, this means that the **range of a buffer** is equal to $pK_a\pm 1$, where $pK_a$ is that of the **acid/conjugate acid of the base**.

View File

@ -1,867 +0,0 @@
# HL Chemistry 3
The course code for this page is **SNC4MZ**.
## Organic chemistry
!!! definition
- An **organic molecule** is one with at least one carbon atom covalently bonded to another carbon or hydrogen atom (i.e., at least one C-H or C to C bond)
Carbon is unique in organic chemistry as it is the only element with the following properties:
- It is in the second row of the periodic table, meaning it has less electron shells, thus forming stronger bonds
- It can covalently bond to up to 4 other atoms
- Because each of its valence electrons is involved in bonding, it can form single through triple bonds
- The molecular geometry can be anything from tetrahedral to linear depending on its bonding
Carbon is also able to bond to itself in the following ways:
- long straight chains
- long straight chains with branches
- rings
<img src="/resources/images/cool-carbon.png" width=700>(Source: Kognity)</img>
### Simple hydrocarbons
!!! definition
- A **branched hydrocarbon** is one with at least one "side group" extending from the main hydrocarbon chain.
- A **functional group** is a group of atoms responsible for the characteristic properties of a molecule (e.g. C=C)
- A **homologous series** is a family of organic compounds with the same functional group but the hydrocarbon chain length changes by 1 $\ce{CH2}$ group.
These only contain carbon and hydrogen.
**Alkanes** are a homologous series that only contain single bonds between carbons, and are named with the number of carbons with the suffix "-ane".
<img src="/resources/images/alkanes.png" width=700>(Source: Kognity)</img>
| Carbon atoms | Prefix |
| --- | --- |
| 1 | Meth |
| 2 | Eth |
| 3 | Prop |
| 4 | But |
| 5 | Pent |
| 6 | Hex |
| 7 | Hept |
| 8 | Oct |
| 9 | Non |
| 10 | Dec |
!!! example
A molecule with only hydrogen and three carbon atoms all held together with single covalent bonds is called "propane".
**Alkenes** contain **at least** one carbon-carbon double bond and are named with a prefix with the total number of carbon atoms and "-ene".
**Alkynes** contain **at least** one carbon-carbon triple bond and are named with a prefix with the total number of carbon atoms and "-ene".
!!! warning
The lack of standardisation prior to IUPAC means that some IUPAC names have common names that are still widely used today.
- acetylene: **ethyne**
- vinyl / ethylene: **ethene**
The general formula for an **acyclic** hydrocarbon with no rings is as follows, where $n$ is the number of carbon atoms, $x$ is the number of double bonds, and $y$ is the number of triple bonds.
$$\ce{C_nH_{2n+2-2x-4y}}$$
### Representing organic compounds
A simple **molecular formula** is the least useful as it provides no information on structure and bonding.
$$\ce{C6H14}$$
A **complete structural diagram** shows all atoms by their chemical symbols and uses lines like a Lewis Dot diagram to represent bonds. VSEPR shapes do not need to be taken into account because these are 2D representations of the molecule.
A **condensed structural diagram** is a complete structural diagram but C-H bonds are aggregated into a formula.
$$\ce{CH3 - CH2 - CH2 - CH2 - CH2 - CH3}$$
A **structural formula** or **expanded molecular formula** is a condensed structural diagram but there are no bond lines. The bond organisation is inferred based on the number of hydrogens on each carbon. Carbon chain side groups (branches) are shown with parentheses.
$$\ce{CH3CH2CH2CH2CH2CH3}$$
A **condensed structural formula** is a structural formula but any consecutive repeated $\ce{CH2}$ groups are factored with parentheses.
$$\ce{CH3(CH2)_4CH3}$$
A **line diagram** or **skeletal structural formula** removes carbons and hydrogens and replaces all carbon-carbon bonds with lines, where the number of lines represents the type of bond. Each line is bent where a carbon atom would be, except for triple bonds as those are linear. Non-carbon groups such as $\ce{OH}$ can be shown in collapsed form.
!!! example
These are the ways to represent pentane, $\ce{C5H12}$. The structural formula is mislabeled as a condensed structural diagram.
<img src="/resources/images/pentane.png" width=700>(Source: Kognity)</img>
### General nomenclature
To name an organic compound:
1. Find the **longest acyclic chain** of carbon atoms as the parent chain.
2. Assign numbers from 1 to $n$ for each carbon atom in the parent chain.
- The numbers should be arranged in a way that the highest priority functional group in the chain is assigned the lowest number possible.
- Apply the **first branch rule** only if there is a tie: If there are side chains, the parent chain should be numbered such that the location of any side chains have the lowest number possible.
- If there is a tie, the location with the most branches wins.
- If there is a tie, the rest of the chain is compared in sequence applying the first branch rule.
- If there is a tie, the first location with the side chain group name that is alphabetically greater wins.
- If there is a tie, it doesn't matter which side is picked as the whole thing is symmetrical.
3. Name the main chain based on the name of the functional group and location number for the functional group in the format "number-name".
4. Name the side groups.
- If the group is not carbon, name it by its identity.
- Otherwise, name the hydrocarbon based on the number of carbons in the side group with the ending "yl".
- If there is more than one identical side group in the **whole chain**, combine their numbers and names with a Greek prefix.
- Assign a number representing the carbon atom of the parent chain that the side group is attached to in the form "numbers-name".
5. Arrange the name with each side group with their numbers in alphabetical order, discounting any prefixes due to duplicates, followed by the parent chain.
6. Join everything together:
- Drop the ending vowel from the prefix if there is a double vowel unless it is "i".
- Separate numbers from words with dashes.
- Separate numbers from numbers with commas.
- Do not separate words from words.
!!! tip
In hydrocarbons:
- Atoms with double or triple bonds share equal priority as the highest functional group.
- The main chain will be named as an alkane if there are only single bonds.
- If there is exactly one double or triple bond, it will be named as an alkene or alkyne with its position inserted between the prefix and ending.
- e.g., "pentane", "pent-2-ene"
- If there are multiple double or triple bonds, their numbers are also included, but an "a" is appended to the prefix and a Greek prefix added to the suffix.
- e.g., "penta-1,3-diene", "hexa-1,3,5-triyne"
- If there are both double and triple bonds, the "-ene" becomes "-en" and is always before "-yne".
- e.g., "pent-4-en-2-yne"
!!! example
tf
Other **side chains** with equal priority as double or triple bonds *in side chains* include:
- halogens, which have their "-ine" suffix replaced with "o" (e.g., "chloro")
- $\ce{NO2}$: "nitro-"
- benzene (as a side chain): "phenyl"
If there is no other option and there is a **branched side chain**, name it based on the total number of carbon atoms in the side chain.
!!! example
tf
### Cyclic aliphatic hydrocarbons
These contain rings that **are not** benzene rings.
$$\ce{C_nH_{2n-2x}}$$
!!! warning
Cyclic hydrocarbons **do not** contain any triple bonds as it would force the carbon ring to widen too much.
Cyclic aliphatic hydrocarbons are named the same way as acyclic hydrocarbons except they have a "**cyclo-**" at the start of the name of their parent chain.
!!! example
cyclohexa-1,3-diene
The initial double bond should be numbered such that the lowest number is assigned to both sides of the bond (numbers 1 and 2 should be to either side of the double bond). If there is more than one double bond, the ring should be numbered such that the lowest number is assigned to both.
The **first branch rule** still applies. (See [HL Chemistry 3#General nomenclature](/snc4mz/#general-nomenclature).)
!!! example
tf
!!! warning
Rings can be side chains, and are named accordingly (e.g., "cyclopropyl"). The "cyclo-" prefix is counted when sorting names alphabetically as it describes the group.
### Cyclic aromatic hydrocarbons
These contain benzene rings, which do not actually have single/double bonds as they actually have delocalised pi bonds.
<img src="/resources/images/benzene.png" width=700>(Source: Kognity)</img>
As benzene rings do not have double bonds, they are named according to the **first branch rule**.
### Isomers
**Structural isomers** are two chemicals that have the same chemical formulas but have different structural formulas, resulting in different chemical properties.
**Hydrocarbon chain isomers** are two chemicals with the same chemical formulas but have different carbon/hydrogen arrangements.
!!! example
The following are two hydrocarbon chain isomers (and, by extension, structural isomers) of $\ce{C5H12}$.
<img src="/resources/images/structural-isomer-g5h12.png" width=700>(Source: Kognity)</img>
**Positional isomers** are two chemicals with the same chemical formulas **and functional groups** but have different structural formulas.
!!! example
The following are positional isomers (and, by extension, structural isomers) of $\ce{C4H8}$.
<img src="/resources/images/positional-isomers.png" width=700>(Source: Kognity)</img>
**Functional group isomers** are chemicals with the same chemical formulas but **different functional groups**.
!!! example
The following are functional group isomers (and, by extension, structural isomers) of $\ce{C3H6O2}$.
<img src="/resources/images/functional-group-isomers.png" width=700>(Source: Kognity)</img>
**Geometric** or **cis/trans isomers** are two chemicals have the same chemical formulas and atom arrangements but are positioned differently, thus having ambiguous names.
In order for this to occur, there must be two different atoms or groups of atoms bonded to each carbon atom in the double bond.
- A **cis** hydrocarbon isomer will have its main chain enter and exit the double bond on the **same side**.
- A **trans** hydrocarbon isomer will have its main chain enter and exit the double bond on **opposite sides**.
Unlike the examples below, these should be named with "cis" or "trans" at the beginning as a **separate word without a hyphen**.
!!! example
The following are two geometric isomers of but-2-ene:
<img src="/resources/images/cis-trans-but-2-ene.png" width=700>(Source: Kognity)</img>
- In acyclic compounds, this is because the double bond prevents simply rotating one side but not the other as it would force breaking the pi bond.
- In cyclic compounds, this is because the ring's other side is similar to a double bond, preventing rotation around the axis.
!!! example
The following are cis-trans isomers of dichlorocyclobutane (notice the chlorine):
<img src="/resources/images/cis-trans-ring.png" width=700>(Source: Kognity)</img>
Isomers may have different physical properties in:
- **polarity**: a cis isomer may cause a molecule to be polar as opposed to its trans variant
- **packing efficiency**: a non-branching hydrocarbon chain will pack better than a branching one, and a continuously trans chain will pack better than a cis one
These change the strength and type of intermolecular forces involved so affect their melting/boiling points.
Isomers may also have different chemical properties as cis isomers are more likely to bump into themselves to make some reactions more viable
### Benzene reactions
!!! definition
- An **electrophile** is any species that is or would be electron deficient (+) in the presence of a pi bond.
In reactions involving a benzene ring, the ring itself is **stable** and will not break apart because of the strength of delocalised pi bonds.
Therefore, only the hydrogens can be swapped out via **electrophilic substitution**, where an hydrogen atom is substituted with an electrophile. The concentration of electrons in the delocalised pi area attracts electrophiles to initiate the bond.
In the mechanism diagram below, $\ce{E+}$ represents the electrophile. Curly arrows are used to show the movement of electrons from the **delocalised area to the electrophile** and **hydrogen atom to the delocalised area**.
<img src="/resources/images/benzene-substitution-mechanism.png" width=900>(Source: Kognity)</img>
The **first step** (the change from the first to the second diagram) is the **slow step** due to the highest activation energy due to the requirement to break a bond.
<img src="/resources/images/benzene-substitution-mechanism-graph.png" width=900>(Source: Kognity)</img>
#### Benzene nitration
!!! definition
- A **nitrating mixture** is a mixture of concentrated sulfuric and nitric acids.
In a **nitrating mixture**, benzene will react with positive nitronium ions at **~50°C** to form nitrobenzene, outlined in the reaction mechanism diagrams below.
$$\ce{C6H6 + HNO3_{(aq)} ->[conc H2SO4][50^\circ C] C6H5NO2 + H2O_{(l)}}$$
<img src="/resources/images/benzene-nitration-mechanism.png" width=900>(Source: Random Quora Person)</img>
The first step is to **form the nitronium ion** through a Bronsted-Lowry acid-base reaction between the acids.
$$\ce{HNO3_{(aq)} + H2SO4_{(aq)} <=> H2NO3+_{(aq)} + HSO4-_{(aq)}}$$
The lone pair on the oxygen of the nitric acid attracts a hydrogen atom, which becomes an $\ce{H+}$ ion as sulfuric acid's oxygen takes its electrons. The hydrogen ion bonds to the nitric acid.
$$\ce{H2NO3+_{(aq)} <=> H2O_{(l)} + NO2+_{(aq)}}$$
The oxygen-hydrogen group is conveniently able to form water by taking both electrons it was sharing with the nitrogen. The other single-bonded oxygen compensates with a dative covalent bond with the nitrogen to form the nitronium ion.
The second step is to **react with benzene** through electrophilic substitution, with electrons moving back from the dative oxygen-nitrogen bond back to the oxygen.
### Alkane reactions
!!! definition
- **Halogenation** is the introduction of a halogen into a compound.
#### Substitution halogenation
Because a sigma bond must be broken, alkanes are not very reactive. In the presence of light, alkanes will react with halogens in their standard state through halogenation, replacing one of their hydrogens. **Fluorine** is an exception that does not require light because it is highly reactive.
If the halogen is in excess and the reaction continues, more of the halogen (**not the hydrogen-halogen product**) will react with the alkane until all hydrogens have been substituted.
!!! example
$$\ce{CH3CH3 + Cl2_{(g)} ->[light] CH3CH2Cl + HCl_{(g)}}$$
If $\ce{Cl2}$ is in excess:
$$
\ce{
CH3CH2Cl + Cl2_{(g)} ->[light] CH3CHCl2 + HCl_{(g)} \\
... \\
CCl3CHCl + Cl2_{(g)} ->[light] CCl3CCl3 + HCl_{(g)}
}
$$
The order that hydrogens are substituted in is **random**. If there is more than one possibility, all of them are written as products, ignoring balancing.
!!! example
Propane reacts with chlorine gas to form either 1-chloropropane or 2-chloropropane.
$$\ce{CH3CH2CH3 + Cl2 ->[hf] CH3CH2CH2Cl + CH3CHClCH3 + HCl}$$
!!! example
1-bromoethane reacts with chlorine gas to form either 1,1-dibromoethane (40% chance) or 1,2-dibromoethane (60% chance) because each hydrogen is equally likely to be substituted, and there are 2 and 3 that would form them, respectively.
$$\ce{CH2ClCH3 + Cl2 ->[hf] CHCl2CH3 + CH2ClCH2Cl + HCl}$$
#### Free radical substitution
!!! definition
- A **free radical** is a species with a lone unpaired electron.
- **Homolytic fission** is the dissociation of a chemical bond in a neutral molecule where each product takes one electron, generating two free radicals.
- **Heterolytic fission** is the dissociation of a chemical bond in a neutral molecule where one product takes both electrons.
The free radicals are first produced with the help of light energy.
$$\ce{Br2 ->[hf] Br. + Br.}$$
They are then spread to organic compounds and reformed.
$$
\ce{
Br. + CH4 -> .CH3 + HBr \\
Br2 + .CH3 -> CH3Br + Br.
}
$$
This cycle only ends when all radicals are used up, through reactions that end up with a net loss in radicals, such as:
- $\ce{Br. + Br. -> Br2}$ (unlikely, contributes a little)
- $\ce{.CH3 + Br. -> CH3Br}$ (likely)
- $\ce{.CH3 + .CH3 -> CH3CH3}$ (likely)
!!! warning
The free radical is on the carbon atom, not the hydrogen atoms, so the marker goes at the beginning.
### Alkene/yne addition reactions
!!! definition
- A **carbocation** is a compound with a $\ce{C+}$ atom.
- The **primary** (1°), **secondary** (2°), and **tertiary** (3°) carbocations are carbocations bonded to one, two, and three other carbon atoms, respectively.
The presence of double/triple bonds make alkenes and alkynes more reactive and also allow the **addition** of species as pi bonds are easier to break. Addition always takes precedence over substitution when possible.
These **spontaneous** reactions break the double/triple bond down a level and slot themselves in (i.e., alkynes form alkenes, alkenes form alkanes).
$$
\ce{alkene + Br2 -> alkaneBr2} \\
\ce{alkyne + Br2 -> alkeneBr2}
$$
<img src="/resources/images/alkene-addition.png" width=900>(Source: Kognity)</img>
1. If the non-alkene/yne reactant does not have a dipole moment, the electrons concentrated in the double/triple bond of the alkene/yne induce a dipole by repelling the electrons closest to it.
2. The positive dipole (such as H in HBr) is attracted to the double bond, and **two electrons** in the bond are used to form a **dative** bond with the positive dipole.
3. No longer needing its old bond, the previously positive dipole loses **both electrons** in its old bond to the negative dipole.
4. The now positive carbon atom attracts the now negative ion.
5. The negative ion forms a **dative** bond with the positive carbon atom.
!!! warning
- If an **alkene is formed**, the same randomness of where the atoms attach applies, so it is possible that a cis/trans isomer is formed.
- If an **asymmetrical alkane** is formed, the same randomness of where the atoms attach applies after applying Markovnikov's rule, so it is possible that positional isomers are formed.
**Markovnikov's rule** states that in Soviet Russia, the rich get richer. Hydrogens preferentially bond to the carbon with the **most hydrogens** if there is one — otherwise it randomly chooses one available.
This is because carbocations with that are *more highly substituted* (are bonded to more carbon atoms) are more stable, so they last longer and are more likely to form a bond with the negative dipole.
The preferred product is the **major product** while the other is the **minor product**. Some minor product will still be produced if the negative dipole is speedy enough, although it will be vastly outnumbered by the major product.
#### Halogenation
Unlike alkane substitution, addition halogenation is spontaneous.
$$\ce{alkene + Br2 -> alkaneBr2}$$
!!! example
This process is used to test for alkenes/alkynes in a solution. As bromine water is red-brown, if alkenes/alkynes are present, the water will be **decolourised** from red-brown to become more colourless.
!!! example
<img src="/resources/images/halogenation.jpeg" width=700>(Source: Kognity)</img>
#### Hydrogenation
The addition of hydrogen follows the same principle as that of halogenation.
$$\ce{alkene + H2 ->[\text{heat, high pressure, Ni/Pt/Pd}] alkane}$$
!!! example
<img src="/resources/images/hydrogenation.png" width=700>(Source: Kognity)</img>
#### Hydrohalogenation
The addition of both a hydrogen and halogen follows similar principles.
$$\ce{alkene + HBr -> alkaneBr}$$
#### Hydration
Hydration is the addition of an $\ce{H-OH}$ group (colloquially known as water) onto an alkene/yne within 6 mol/L $\ce{H+}$ to produce an alcohol.
$$\ce{alkene + H2O ->[6 mol/L H+] alkaneOH}$$
!!! example
<img src="/resources/images/hydration.jpeg" width=700>(Source: Kognity)</img>
### Nucleophilic substitution
!!! definition
- A **nucleophile** is a species with a lone pair or a negative charge.
Nucleophilic substitution replaces a group of atoms attached to a C with a nucleophile. Both processes involve the **leaving group** taking both electrons, becoming negative in the process, and forming a carbocation as the other product, which attracts and bonds with the nucleophile.
Effectively all reactions here involve the formation or stealing of dative covalent bonds.
Where $\ce{X}$ is a halogen:
$$\ce{R-X_{(l)} + OH-_{(aq)} -> R-OH_{(aq)} + X-_{(aq)}}$$
If substituting with hydroxide, it must be **warm** and **aqueous** (dilute).
Generally:
| Carbocation type | Substitution type |
| --- | --- |
| Primary | S<sub>N</sub>2 |
| Secondary | Both/either |
| Tertiary | S<sub>N</sub>1 |
#### S<sub>N</sub>1
This **two-step** reaction involves the heterolytic fission of the C-X bond to form a carbocation + halide ion (slow), followed by the nucleophile's lone pairs/negative charge attracting it to the carbocation.
The "1" refers to the order of the rate-limiting step being a **unimolecular** collision.
<img src="/resources/images/sn1-1.png" width=700 />
<img src="/resources/images/sn1-2.png" width=700>(Source: Kognity)</img>
!!! warning
Be sure to draw VSEPR, unlike in the diagrams above.
#### S<sub>N</sub>2
This **single-step** reaction has the nucleophile forming a bond with the central atom **opposite the leaving group** in a "back-side attack". The oncoming nucleophile repels the other groups, causing them to move away, effectively **reflecting** ("inverting") the remaining groups across the vertical axis.
The "2" refers to the order of the rate-limiting step being a **bimolecular** collision.
<img src="/resources/images/sn2-substitution.png" width=900>(Source: Kognity)</img>
!!! warning
Dashes must be drawn for the transition state for bonds breaking/forming. In this case, drawing the front/back lines for the bottom two atoms may be ignored in favour of regular lines instead to avoid the ambiguity of forming bonds.
#### Factors affecting substitution type
**Steric hindrance** is the effect of other parts of a molecule getting in the way to the central atom, preventing a reaction. If there is not enough space for a backside attack, S<sub>N</sub>2 cannot happen. Therefore, this makes 3° S<sub>N</sub>2 substitution not viable.
**Steric stress reduction** is the resistance of groups against being forced together. In a 3° carbocation, pushing the groups together for a backside attack increases steric stress. This encourages S<sub>N</sub>1 substitution **only for 3°** to maintain a tetrahedral geometry.
The **positive inductive effect** is the effect that causes more highly substituted carbons to be more stable. Electrons on neighbouring carbon atoms can move closer to the carbon ion, creating an electron-donating effect that slightly balances its charge, increasing its stability and thus window of opportunity for a **S<sub>N</sub>1** substitution.
### Alcohols
An **alcohol** is an organic compound with a $\ce{-OH}$ (hydroxyl) functional group.
It has a **higher priority** than double and triple bonds, and alcohol names are suffixed with **-ol**.
!!! warning
The -ol suffix is a standard suffix following the same numbering rules as -en and -yne. As functional groups are ordered from lowest to highest priority in their name, similar to how a -yne can have an -en, an -ol can also have an -en and **-yn** before it.
- Therefore, $\ce{CH3OH}$ is methanol, *not* methol.
!!! example
Some alcohols and their common names:
- **Glycerol**: propan-1,2,3-triol
- **Ethyl alcohol** or drinking alcohol: ethanol
- **Isopropanol** or rubbing alcohol: propan-2-ol
The **type** of an alcohol (primary/secondary/tertiary) is that of the would-be carbocation it is attached to.
#### Alcohol combustion
Alcohols are combustible, and can undergo complete and incomplete combustion.
$$
\ce{alcohol + O2 -> CO2 + H2O (complete) \\
alcohol + O2 -> CO2 + H2O + CO + C (incomplete)}
$$
#### Alcohol elimination
Under significantly more acidic conditions than hydration, the opposite process can be used to revert an alcohol into its base components.
$$\ce{alcohol ->[12 mol/L H2SO4] H2O + alkene}$$
!!! warning
When choosing a new double bond to form in the alkene, it must bond to the carbon the OH group was attached to. In elimination, **Markovnikov's rule does not apply**.
### Aldehydes
!!! definition
- A **carbonyl** is $\ce{C=O}$.
- A **hydroxyl** is $\ce{-OH}$. In a side group, it is named **hydroxy**.
In the presence of an oxidising agent that is **limited** and acid, **primary** alcohols will oxidise to form aldehydes, where a hydroxyl group becomes a carbonyl group and the hydrogen migrates to the carbon.
- $\ce{K2Cr2O7}$
- $\ce{Cr2O7^2-}$
- $\ce{KMnO4}$
- $\ce{MnO4-}$
An aldehyde is named like an alcohol but has a higher naming priority, with a suffix of **-al**. As aldehydes must be at the end of a chain, numbering their position is not required.
!!! example
- butanal ($\ce{CH3CH2CH2COH}$)
- The common name of **methanal** is **formaldehyde**.
<img src="/resources/images/alcohol-aldehyde.png" width=900>(Source: Kognity)</img>
Aldehydes will continue to react to carboxylic acids if the oxidising agent is not limited. To prevent this, the aldehyde is separated and removed from the mixture through distillation.
<img src="/resources/images/aldehyde-distillation.png" width=900>(Source: Kognity)</img>
The mixture is heated to a temperature greater than the aldehyde's boiling point but less than the alcohol's, such that the gaseous aldehyde enters the condenser and is cooled by the water jacket.
An aldehyde can also be reduced in a process similar to **hydrogenation** to reverse the reaction.
$$\ce{aldehyde + H2 ->[\text{high temp, high pressure, Pt/Pd/Ni}] alcohol}$$
### Ketones
In the presence of an oxidising agent and acid, **secondary** alcohols will oxidise to form ketones, where the hydrogen plops off completely.
<img src="/resources/images/alcohol-ketone.png" width=900>(Source: Kognity)</img>
Because there is no possible reaction afterward (no more hydrogens), distillation is not required.
Ketones have equal priority to aldehydes and are named the same but with a suffix of **-one**. A position number *is* required because ketones can be located anywhere on the chain.
!!! example
- 3-ethyl-4,4-difluoro-5-hydroxylhexan-2-one
- 1,1-dibromo-4-cyclopropylhex-5-en-2-one
### Carboxylic acids
Aldehydes will react again if there is excess oxidising agent to form a carboxylic acid.
<img src="/resources/images/alcohol-acid.png" width=900>(Source: Kognity)</img>
Instead of distillation, **reflux** is used to keep the aldehyde in the mixture. The vaporised aldehyde condenses and returns to the mixture.
<img src="/resources/images/alcohol-reflux.png" width=900>(Source: Kognity)</img>
Carboxylic acids have higher priority than aldehydes/ketones and are named the same but with a suffix of **-oic acid**. Similar to aldehydes, because the $\ce{COOH}$ can only exist on the end of a chain, position numbers are omitted.
!!! example
- **Benzoic acid**: $\ce{benzene-COOH}$
- 3,3-difluoropent-4-enoic acid
- 3-ethylhexanedioic acid
- The common name of **ethanoic acid** is **acetic acid**.
- The common name of **ethanedioic acid** is **oxalic acid**.
- The common name of **methanoic acid** is **formic acid**.
- Look up citric acid because I'm not writing that down.
#### Carboxylic acid salts
If the ionising hydrogen is removed ($\ce{COOH -> COO-}$), a carboxylic acid can form a salt by reacting with a metal to form an **ionic compound**. Salts are named as an ionic compound would be, with the acid component resuffixed to **-oate**.
$$\ce{R-COOH + NaOH -> R-COONa + H2O}$$
!!! example
- sodium ethanoate
- lithium benzoate
#### Identifying alcohols
The **Lucas test** is used to in part determine the type of alcohol (primary/secondary/tertiary) through the **nucleophilic substitution** of OH with Cl. To perform this substitution, **anhydrous** zinc chloride and **concentrated** HCl must be present.
$$\ce{R-OH + HCl ->[ZnCl2] R-Cl + H2O}$$
This test is only valid on **small** alcohols because (<6 carbons) as longer ones are insoluble.
The insoluble halogenoalkane becomes visible, making the solution **cloudy**. Because the reaction is an S<sub>N</sub>1 reaction:
- Primary alcohols will **not** react
- Secondary alcohols react slowly
- Tertiary alcohols react rapidly
Alternatively, **oxidising** alcohols to aldehydes/ketones through S<sub>N</sub>2 by reducing $\ce{Cr2O7^2-}$ (orange) to $\ce{Cr^3+}$ (green) will identify the alcohol.
- Primary alcohols will react quickly
- Secondary alcohols will react slowly
- Tertiary alcohols will **not** react
### Ethers
!!! definition
- A **condensation reaction** or **dehydration synthesis** involves two small molecules reacting to form water and another molecule.
Ethers are formed by reacting two alcohols through dehydration synthesis in sulfuric acid.
$$\ce{R-OH + HO-R ->[H2SO4] R-O-R + H2O}$$
To name ethers, the shorter alkyl group is named as a side chain while the longer is as the main chain, separated by "oxy".
$$\ce{short + oxy + long}$$
Usually, if the "side chain" is at position 1, the position number is omitted.
!!! example
- pentoxypentane (pentan-1-ol + pentan-1-ol)
- 2-ethoxybutane (ethan-2-ol + butan-1-ol)
- 2-chloro-3-methoxypentane (chloro is at position 2, methoxy is at position 3 on the pentane)
- The common name of **ethoxyethane** is **diethyl ether**.
### Esters
When an alcohol and carboxylic acid react in sulfuric acid **and heat**, the only the $\ce{O}$ from the alcohol remains in the ester while that in the acid forms a water. The formed $\ce{COO}$ is known as the **ester linkage**.
<img src="/resources/images/ester-formation.png" width=900>(Source: Kognity)</img>
Esters are named with the alcohol as the side group and the acid as its salt variant with a space in between. If the side chain looks like an alkane, its position number and -ane suffix can be dropped.
$$\text{alcohol-yl acid-oate}$$
!!! warning
The carbon in the ester linkage is included as a carbon of the main chain of the ester.
!!! example
- Propyl pentanoate or propan-1-yl pentanoate is formed from propan-1-ol and pentanoic acid.
- Propyl 2-chloroethanoate
- Hexan-3-yl propanoate
Esters hydrolyse to their original components if catalysed by an acid or base.
$$\ce{ester + H2O ->[H2SO4] alcohol + carboxylic acid}$$
$$\ce{ester + H2O ->[NaOH] alcohol + RCOONa ->[react with acid] alcohol + carboxylic acid}$$
### Amines
Amines are $\ce{NR3}$ derived from ammonia ($\ce{NH3}$), where R is either H or a carbon group. Similar to alcohols, they can be primary/secondary/tertiary depending on the number of carbon groups attached. The **main chain** is the longest carbon chain.
Amines have a priority between double/triple bonds and alcohols, and are named like alcohols but with a suffix of **-amine**.
If there are any side groups attached to the nitrogen, they are named as if they were side groups on the main chain with a **number of $N$**.
!!! example
<img src="/resources/images/amine-name-simple.png" width=700 />
<img src="/resources/images/amine-name-mid.png" width=700 />
<img src="/resources/images/amine-name-hard.png" width=700>(Source: Kognity)</img>
#### Amine synthesis
Amines can be formed through **halogenoalkane substitution**, where ammonia or another amine is alkylated in an S<sub>N</sub>2 reaction.
$$\ce{NH3 + CH3Cl -> CH3NH4Cl ->[OH-] CH3NH2}$$
!!! example
$\ce{CH3NH2 + CH3Cl -> CH3NH2CH3Cl ->[OH-] CH3NH2CH3}$
### Amides
Amides are formed from a reaction between an amine and a carboxylic acid through dehydration synthesis, similar to the formation of an ester. The $\ce{N-C=O}$ link is known as the **amide link**.
$$\ce{R-COOH + N-R -> R-CON-R}$$
Amides carry the suffix **-amide** and are otherwise named equivalently to esters, but *without* spaces.
!!! example
<img src="/resources/images/amide-names.png" width=700>(Source: Kognity)</img>
### Nitriles
Nitriles consist of a cyanide(s) attached at the end of a carbon chain.
$$\ce{R-C#N}$$
As they can only be placed at the end of a carbon chain, a positional number is not used. These have the highest priority of all organic compounds and use the suffix **-nitrile** and the prefix **cyano-**.
!!! example
- methanenitrile
- methanedinitrile
Nitriles are synthesised through the nucleophilic substitution of halogenoalkanes, **extending their carbon chain**.
$$\ce{R-X + C#N- -> R-C#N + X-}$$
### Reduction reactions
**Hydride reagents** include $\ce{LiAlH4}$ and $\ce{NaBH4}$, the former of which requires ether because it reacts violently with water. Always use $\ce{LiAlH4}$ unless specified otherwise.
**Aldehydes** can be reduced to **primary alcohols**.
$$\ce{aldehyde ->[LiAlH4, ether, then acid] 1^\circ alcohol}$$
**Amides** can be reduced to their **amines**, reacting twice such that the O pops off. The name is a simple `amide.replace("amide", "amine")`.
$$\ce{amide ->[LiAlH4, ether, then acid] amine}$$
!!! warning
$\ce{LiAlH4}$ is required for this reaction.
**Carboxylic acids** can be reduced to **primary alcohols** with the $\ce{C=O}$ plopping off.
$$\ce{carboxylic acid ->[LiAlH4, ether, then acid] 1^\circ alcohol}$$
**Esters** can be reduced to **two primary alcohols** with each alcohol keeping an O and gaining an H to make OH.
$$\ce{ester ->[LiAlH4, ether, then acid] 1^\circ alcohol + 1^\circ alcohol}$$
**Nitriles** can be double reduced to **amines**.
$$\ce{nitrile ->[LiAlH4, ether, then acid] amine}$$
### Retro-synthesis
Retro-synthesis is basically a language of math but for chem, with products on the left and reactants on the right. The bottom right contains initial reactant(s) and the top left contains the product(s).
"A is made from B which is made from C":
$$\ce{
A => B react with alcohol using H2SO4 in reflux \\
B => C
}$$
!!! example
$$\ce{
ethanoic acid => ethanol (react w/K2Cr2O7 in H+) \\
ethanol => chloroethane (react w/warm dilute hydroxide)
}$$
### Simple polymers
!!! definition
- **Polymers** are large molecules made from many monomers in long chains.
- **Plastics** are polymers formed through addition.
- A **homopolymer** has identical monomers.
- A **heteropolymer** has multiple distinct monomers.
- A **monomer** is the repeating segment in a polymer.
Polymer properties change based on the type of linkages, the presence of side chains, and the extent of crosslinking between other chains.
The **addition formation** of an **addition polymer** opens up pi bonds which are used to bond to other monomers. Monomers are continuously added until the process ends with hydrogen atoms capping the ends.
<img src="/resources/images/addition-polymer.png" width=700>(Source: Kognity)</img>
Only the two carbons directly involved in the double bond go in the main chain of the polymer, with all others expressed as side groups.
<img src="/resources/images/addition-polymer-notation.png" width=900>(Source: Kognity)</img>
**Polymer notation** is the formula/condensed formula/structural diagram of the **repeating unit only** with crossed out brackets and the number of repetitions at the bottom right (or $n$ if unknown). Side groups should be clearly expressed as side groups. Polymers are named with the prefix **poly-** on the repeating unit.
!!! example
$$\ce{-(-CH2-CH2-) -_3}$$
#### Crosslinking
!!! definition
- **Crosslinking** is the bond between side chains of separate polymers, connecting them.
The crosslinking between polymers depends on the side chains. If there are multiple double bonds in monomers, those can be used in different chains which can attach them together.
!!! example
divinylbenzene
!!! example
If an OH side group meets another OH side group, they may react to form $\ce{O=O}$ and connect the two polymers.
### Polyesters and polyamides
!!! definition
- **Condensation polymers** are polymers formed via dehydration synthesis and produce water.
A **polyester** has monomers connected via an ester linkage on both ends. **Unlike addition polymers**, any carbons between the functional groups are included in the parent polymer chain.
<img src="/resources/images/polyester-formation.png" width=700>(Source: Kognity)</img>
The repeating unit should be **copy-pastable** — it should not end with oxygen on both ends. The link is broken where it would normally break — between the C-O of the ester linkage, such that the O goes to the side of the alcohol.
<img src="/resources/images/polyester-notation.png" width=700>(Source: Kognity)</img>
A **polyamide** has monomers connected via an amide linkage on both ends.
<img src="/resources/images/polyamide-formation.png" width=700>(Source: Kognity)</img>
!!! warning
There should be a hydrogen attached to the nitrogen at the end of the amine.
### E/Z isomers
E/Z isomers are a generalised form of cis-trans isomers, where priority is determined by atomic number. If both sides with the higher atomic number are on the **same** side, the isomer is a Z-isomer (German: *ze zame zide*). E/Z isomers are placed at the beginning surrounded by parentheses.
!!! example
(Z)-2-bromo-1-chloro-1-fluoroethene:
<img src="/resources/images/ez-example.png" width=700>(Source: Kognity)</img>
If the atoms are of equal priority, the sum of atomic numbers that they are directly connected to are compared (double bonds count twice), repeating as necessary.
!!! example
(Z)-1-chloro-1-fluoro-2-methyl-1-butene (left) and (E)-1-chloro-1-fluoro-2-methyl-1-butene (right).
<img src="/resources/images/special-ez-isomer.png" width=700>(Source: Kognity)</img>
If there are multiple E/Z isomers, they are separated by commas and numbered according to their earliest position on the main chain.
!!! example
(2Z, 3E)-R
### Optical isomers
!!! definition
- An **enantiomer** is an optical isomer.
- A **chiral centre** is a carbon atom with four different groups attached to it.
- The **chirality** of a carbon atom represents its ability to form an enantiomer.
- A **racemic mixture** is a mixture of exactly one half of each enantiomer of a species such that it is not optically active.
- A **dextrorotary** enantiomer rotates rightward (+).
- A **levrorotary** enantiomer rotates leftward (-).
Optical isomers are mirrored across the y-axis with the same compounds put on the same bonds. **Four distinct groups** must be attached to the central carbon atom to have optical isomers.
In the data booklet, all amino acids are chiral except for glycine and proline.
!!! example
<img src="/resources/images/enantiomer.ex.png" width=700>(Source: Kognity)</img>
An **optically active** species is one that can rotate the plane of polarised light. Please see [SL Physics 1#Polarisation](/sph3u7/#polarisation) for more information.
A species that rotates the plane clockwise is positive, while counter-clockwise is negative. Both enantiomers have the same magnitude of polarisation except for the direction. If there is a mixture of both enantiomers, the angle changes depending on the proportion of each isomer.
Enantiomers have the same physical properties except for the direction of polarised light. They also have mostly the same chemical properties except for chemical reactions with other enantiomers of different compounds.
### Properties of organic compounds
**Alcohols** are able to form hydrogen bonds, so are soluble in water. Increasing the length of the main chain decreases solubility as the rest of the molecule is non-polar, but this can be compensated by adding more hydroxyls too.
In general:
- m/ethanols are miscible
- butanols are 10-15% v/v miscible
- alcohols longer than octanols are effectively insoluble
Although the boiling point of an alcohol will always be higher than its corresponding alkane, the difference between the two will decrease as chain length increases as the proportion of force the alcohol provides decreases relative to the larger contributor in the LDF from the main chain.
Low mass **esters** smell good, and large mass esters are oily/waxy.
**Amines** smell bad and are all Bronsted-Lowry weak bases because they can accept protons and form dative bonds.
The solubility of compounds is directly related to their melting/boiling point — compounds that cannot hydrogen bond with themselves but can with water have an advantage.
From greatest to lowest melting point:
**Hydrogen bonding**
- Water is able to hydrogen bond with two other molecules per molecule, efficiently using all its lone pairs and Hs.
- Carboxylic acids are less efficient than water but more than alcohols as an the OH can attract to an O on a different molecule.
- Alcohols
- Primary/secondary amines can hydrogen bond but the N-H bond is less polar than O-H, decreasing its strength.
**Dipole-dipole interaction**
- Aldehydes and ketones
- Esters are less polar than aldehydes because the single bond O attracts electrons from the C=O.
- Ethers have horizontal components to their dipole vectors that cancel out, so they are least polar.
**London dispersion forces**
- Alkynes' triple bonds means that packing is easier, increasing LDFs.
- Alkanes
- Alkenes' double bonds means that there are less electrons than their alkane counter parts, reducing LDFs.
$$\ce{
water >> \\
carboxylic acids > alcohols > amines >> \\
ethers > aldehydes/ketones >> \\
alkynes > alkanes > alkenes
}$$
## Resources
- [IB Chemistry Data Booklet](/resources/g11/ib-chemistry-data-booklet.pdf)
- [IB HL Chemistry Syllabus](/resources/g11/ib-chemistry-syllabus.pdf)
- [Significant Figures/Digits](/resources/g11/chemistry-sig-figs.pdf)
- [Error Analysis and Significant Figures (long)](/resources/g11/error-analysis-sig-figs.pdf)
- [General Guidelines for Writing a Formal Laboratory Report](/resources/g11/lab-report-guidelines.pdf)
- [Designing an IB Investigation](/resources/g11/designing-investigation.pdf)
- [Textbook: Pearson Higher Level Chemistry](/resources/g12/textbook-hl-chem.pdf) ([Answers](/resources/g12/textbook-hl-chem-answers.pdf)) - [mini Eifueo](/resources/g12/textbook-hl-chem-eifueo.pdf)

View File

@ -1,20 +1,20 @@
# Home # Home
Eifueo (eh-FWAY-oh) is intended to be primarily for personal use, with documentation here licensed under the GNU Free Documentation License. This website is intended to be primarily for personal use, but is available publically online.
Testing math rendering: $a^2+b^2=c^2$ Testing math rendering: $a^2+b^2=c^2$
| Tables | too! | | Tables | too! |
| ------ | ------- | | --- | --- |
| yeet | no yeet | | yeet | no yeet |
## Contact ## Contact
If you would like to contribute by submitting fixes, requesting pages, and/or complaining about issues, feel free to open an issue on the [issue tracker](https://git.eggworld.tk/eggy/eifueo/issues) or submit a [pull request](https://git.eggworld.tk/eggy/eifueo/pulls), or contact the site administrator at d7chen at uwaterloo.ca. If you would like to contribute by submitting fixes, requesting pages, and/or complaining about issues, feel free to open an issue on the [issue tracker](https://git.eggworld.tk/eggy/eifueo/issues) or submit a [pull request](https://git.eggworld.tk/eggy/eifueo/pulls), or contact the site administrator at [341213551@gapps.yrdsb.ca](mailto:341213551@gapps.yrdsb.ca).
## Source ## Source
The source for Eifueo is available [here](https://git.eggworld.me/eggy/eifueo). The source for Eifueo is available [here](https://git.eggworld.tk/eggy/eifueo).
## Acknowledgements ## Acknowledgements

View File

@ -1,9 +1,5 @@
MathJax.Hub.Config({ MathJax.Hub.Config({
config: ["MMLorHTML.js"], config: ["MMLorHTML.js"],
jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"], jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
extensions: ["MathMenu.js", "MathZoom.js"], extensions: ["MathMenu.js", "MathZoom.js"]
TeX: {
extensions: ["mhchem.js"],
mhchem: {legacy: false}
}
}); });

24
docs/mhf4u7.md Normal file
View File

@ -0,0 +1,24 @@
# SL Math - Analysis and Approaches - A
The course code for this page is **MHF4U7**.
## 4 - Statistics and probability
!!! note "Definition"
- **Descriptive statistics:** The use of methods to organise, display, and describe data by using various charts and summary methods to reduce data to a manageable size.
- **Inferential statistics:** The use of samples to make judgements about a population.
- **Data set:** A collection of data with elements and observations, typically in the form of a table. It is similar to a map or dictionary in programming.
- **Element:** The name of an observation(s), similar to a key to a map/dictionary in programming.
- **Observation:** The collected data linked to an element, similar to a value to a map/dictionary in programming.
- **Raw data:** Data collected prior to processing or ranking.
### Frequency distribution
## Resources
- [IB Math Analysis and Approaches Syllabus](/resources/g11/ib-math-syllabus.pdf)
- [IB Math Analysis and Approaches Formula Booklet](/resources/g11/ib-math-data-booklet.pdf)
- [Calculus and Vectors 12 Textbook](/resources/g11/calculus-vectors-textbook.pdf)
- [Course Pack Unit 1: Descriptive Statistics](/resources/g11/s1cp1.pdf)

3
docs/resources.md Normal file
View File

@ -0,0 +1,3 @@
# IB Resources

24
docs/sch3uz.md Normal file
View File

@ -0,0 +1,24 @@
# HL Chemistry - A
The course code for this page is **SCH3UZ**.
## 11.1 - Uncertainties and errors in measurement and results
!!! info
Please see [SL Physics](/sph3u7/#12-uncertainties-and-errors) for more information.
## 11.2 - Graphical techniques
## 11.3 - Spectroscopic identification of organic compounds
## Resources
- [IB Chemistry Data Booklet](/resources/g11/ib-chemistry-data-booklet.pdf)
- [IB HL Chemistry Syllabus](/resources/g11/ib-chemistry-syllabus.pdf)
- [Significant Figures/Digits](/resources/g11/chemistry-sig-figs.pdf)
- [Error Analysis and Significant Figures (long)](/resources/g11/error-analysis-sig-figs.pdf)
- [General Guidelines for Writing a Formal Laboratory Report](/resources/g11/lab-report-guidelines.pdf)
- [Designing an IB Investigation](/resources/g11/designing-investigation.pdf)

276
docs/sph3u7.md Normal file
View File

@ -0,0 +1,276 @@
# SL Physics - A
The course code for this page is **SPH3U7**.
## 1.1 - Measurements in physics
!!! reminder
All physical quantities must be expressed as a **product** of a magnitude and a unit. For example, ten metres should be written as $10 \text{ m}$.
### Fundamental units
Every other SI unit is derived from the fundamental SI units. Memorise these!
| Quantity type | Unit | Symbol |
| --- | --- | --- |
| Time | Second | s |
| Distance | Metre | m |
| Mass | Kilogram | kg |
| Electric current | Ampere | A |
| Temperature | Kelvin | K |
| Amount of substance | Mole | mol |
| Luminous intensity | Candela | cd |
### Metric prefixes
Every SI unit can be expanded with metric prefixes. Note that the difference between many of these prefixes is $10^3$.
!!! example
milli + metre = millimetre ($10^{-3}$) m
| Prefix | Abbreviation | Value | Inverse ($10^{-n}$) abbreviation | Inverse prefix |
| --- | --- | --- | --- | --- |
| deca- | da | $10^1$ | d | deci- |
| hecto- | h | $10^2$ | c | centi- |
| kilo- | k | $10^3$ | m | milli- |
| mega- | M | $10^6$ | µ | micro- |
| giga- | G | $10^9$ | n | nano- |
| tera- | T | $10^{12}$ | p | pico- |
| peta- | P | $10^{15}$ | f | femto- |
| exa- | E | $10^{18}$ | a | atto- |
### Significant figures
- The leftmost non-zero digit is the **most significant digit**.
- If there is no decimal point, the rightmost non-zero digit is the **least significant digit**.
- Otherwise, the right-most digit (including zeroes) is the least significant digit.
- All digits between the most and least significant digits are significant.
- Pure (discrete) numbers are unitless and have infinite significant figures.
!!! example
In $123000$, there are 3 significant digits.<br>
In $0.1230$, there are 4 significant digits.
- When adding or subtracting significant figures, the answer has the **same number of decimals** as the number with the lowest number of decimal points.
- When multiplying or dividing significant figures, the answer has the **same number of significant figures** as the number with the lowest number of significant figures.
- Values of a calculated result can be **no more precise** than the least precise value used.
!!! example
$$1.25 + 1.20 = 2.45$$
$$1.24 + 1.2 = 2.4$$
$$1.2 × 2 = 2$$
$$1.2 × 2.0 = 2.4$$
!!! warning
When rounding an answer with significant figures, if the **least significant figure** is $5$, round up only if the **second-least** significant figure is **odd**.
$$1.25 + 1.2 = 2.4$$
$$1.35 + 1.2 = 2.6$$
### Scientific notation
Scientific notation is written in the form of $m×10^{n}$, where $1 \leq m < 10, n \in \mathbb{Z}$. All digits before the multiplication sign in scientific notation are significant.<br>
!!! example
The speed of light is 300 000 000 ms<sup>-1</sup>, or $3×10^8$ ms<sup>-1</sup>.
### Orders of magnitude
The order of magnitude of a number can be found by converting it to scientific notation and taking its power of 10.
!!! example
- The order of magnitude of $212000$, or $2.12×10^{5}$, is 5.
- The order of magnitude of $0.212$, or $2.12×10^{-1}$, is -1.
## 1.2 - Uncertainties and errors
### Random and systematic errors
| Random error | Systematic error |
| --- | --- |
| Caused by imperfect measurements and is present in every measurement. | Caused by a flaw in experiment design or in the procedure. |
| Can be reduced (but not avoided) by repeated trials or measurements. | Cannot be reduced by repeated measurements, but can be avoided completely. |
| Error in precision. | Error in accuracy. |
!!! example
- The failure to account for fluid evaporating at high temperatures is a systematic error, as it cannot be minimised by repeated measurements.
- The addition of slightly more solute due to uncertainty in instrument data is a random error, as it can be reduced by averaging the result of multiple trials.
<img src="/resources/images/types-of-error.png" width=700>(Source: Kognity)</img>
### Uncertainties
Uncertainties are stated in the form of $a±\Delta a$. A value is only as precise as its absolute uncertainty. Absolute uncertainty of a **measurement** is usually represented to only 1 significant digit.
- The absolute uncertainty of a number is written in the same unit as the value.
- The percentage uncertainty of a number is the written as a percentage of the value.
!!! example
- Absolute uncertainty: 1.0 g ± 0.1 g
- Percentage uncertainty: 1.0 g ± 10%
To determine a measurement's absolute uncertainty, if:
- the instrument states its uncertainty, use that.
- an analog instrument is used, half of the most precise reading is uncertain.
- a digital instrument is used, the last reported digit is uncertain by 1 at its order of magnitude.
!!! example
- A ruler has millimetre markings. A pencil placed alongside the ruler has its tip just past 14 mm but before 15 mm. The pencil is 14.5 mm ± 0.5 mm long.
- A digital scale reads 0.66 kg for the mass of a human body. The human body has a mass of 0.66 kg ± 0.01 kg.
See [Dealing with Uncertainties](/resources/g11/physics-uncertainties.pdf) for how to perform **operations with uncertainties**.
### Error bars
Error bars represent the uncertainty of the data, typically representing that data point's standard deviation, and can be both horizontal or vertical. A data point with uncertain values is written as $(x ± \Delta x, y ± \Delta y)$
<img src="/resources/images/error-bars.png" width=600>(Source: Kognity)</img>
### Uncertainty of gradient and intercepts
!!! note "Definition"
- The **line of best fit** is the line that passes through **as many error bars as possible** while passing as closely as possible to all data points.
- The **minimum and maximum lines** are lines that minimise/maximise their slopes while passing through the first and last **error bars**.
!!! warning
- Use solid lines for lines representing **continuous data** and dotted lines for **discrete data**.
<img src="/resources/images/error-slopes.png" width=700>(Source: Kognity)</img>
The uncertainty of the **slope** of the line of best fit is the difference between the maximum and minimum slopes.
$$m_{\text{best fit}} ± \frac{m_{\max}-m_{\min}}{2}$$
The uncertainty of the **intercepts** is the difference between the intercepts of the maximum and minimum lines.
$$\text{intercept}_{\text{best fit}} ± \frac{\text{intercept}_{\max} - \text{intercept}_{\min}}{2}$$
## 1.3 - Vectors and scalars
!!! note "Definition"
- **Scalar:** A physical quantity with a numerical value (magnitude) and a unit.
- **Vector:** A physical quantity with a **non-negative** numerical value (magnitude), a unit, and a **direction.**
??? example
- Scalar quantities include speed, distance, mass, temperature, pressure, time, frequency, current, voltage, and more.
- Vector quantities include velocity, displacement, acceleration, force (e.g., weight), momentum, impulse, and more.
Vectors are drawn as arrows whose length represents their scale/magnitude and their orientation refer to their direction. A variable representing a vector is written with a right-pointing arrow above it.
- The **standard form** of a vector is expressed as its magnitude followed by its unit followed by its direction in square brackets.
$$\vec{a} = 1\text{ m }[N 45° E]$$
- The **component form** of a vector is expressed as the location of its head on a cartesian plane if its tail were at $(0, 0)$.
$$\vec{a} = (1, 1)$$
- The **magnitude** of a vector can be expressed as the absolute value of a vector.
$$|\vec{a}| = 1 \text{ m}$$
### Adding/subtracting vectors diagrammatically
1. Draw the first vector.
2. Draw the second vector with its tail at the head of the first vector.
3. Repeat step 2 as necessary for as many vectors as you want by attaching them to the *head* of the last vector.
4. Draw a new ("resultant") vector from the tail of the first vector to the head of the last vector.
<img src="/resources/images/vector-add-direction.png" width=700>(Source: Kognity)</img>
When subtracting exactly one vector from another, repeat the steps above, but instead place the second vector at the **tail** of the first, then draw the resultant vector from the head of the second vector to the head of the first vector. Note that this only applies when subtracting exactly one vector from another.
!!! example
In the diagram above, $\vec{b}=\vec{a+b}-\vec{a}$.
Alternatively, for any number of vectors, negate the vector(s) being subtracted by **giving it an opposite direction** and then add the negative vectors.
<img src="/resources/images/vector-subtract-direction.png" width=700>(Source: Kognity)</img>
### Adding/subtracting vectors algebraically
Vectors can be broken up into two **component vectors** laying on the x- and y-axes via trigonometry such that the resultant of the two components is the original vector. This is especially helpful when adding larger (3+) numbers of vectors.
$$\vec{F}_x + \vec{F}_y = \vec{F}$$
!!! info "Reminder"
The **component form** of a vector is expressed as $(|\vec{a}_x|, |\vec{a}_y|)$
<img src="/resources/images/vector-simple-adding.png" width=700>(Source: Kognity)</img>
By using the primary trignometric identities:
$$
|\vec{a}_{x}| = |\vec{a}|\cos\theta_{a} \\
|\vec{a}_{y}| = |\vec{a}|\sin\theta_{a}
$$
<img src="/resources/images/vector-decomposition.png" width=700>(Source: Kognity)</img>
Using their component forms, to:
- add two vectors, add their x- and y-coordinates together.
- subtract two vectors, subtract their x- and y-coordinates together.
$$
(a_{x}, a_{y}) + (b_{x}, b_{y}) = (a_{x} + b_{x}, a_{y} + b_{y}) \\
(a_{x}, a_{y}) - (b_{x}, b_{y}) = (a_{x} - b_{x}, a_{y} - b_{y})
$$
The length of resultant vector can then be found using the Pythagorean theorem.
$$
|\vec{c}|=\sqrt{c_{x}^2 + c_{y}^2}
$$
To find the resultant direction, use inverse tan to calculate the angle of the vector using the lengths of its components.
$$
\theta_{c} = \tan^{-1}(\frac{c_y}{c_x})
$$
### Multiplying vectors and scalars
The product of a vector multiplied by a scalar is a vector with a magnitude of the vector multiplied by the scalar with the same direction as the original vector.
$$\vec{v} × s = (|\vec{v}|×s)[\theta_{v}]$$
!!! example
$$3 \text{ m} · 47 \text{ ms}^{-1}[N20°E] = 141 \text{ ms}^{-1}[N20°E]$$
## 2.1 - Motion
### Models
A **scientific model** is a simplification of a system based on assumptions used to explain or make predictions for that system.
!!! note "Definition"
- **System**: An object or a connected group of objects.
- **Point particle assumption**: An assumption that models a system as a blob of matter. It is more reliable if the size and shape of the object(s) do not matter much.
- **Uniform motion**: The type of motion in which the speed of an object is constant.
### Displaying motion
Motion can be expressed visually using a **motion diagram** or a **position-time graph**.
// TODO: insert motion diagram here because kognity bad
A **position-time graph** expands on the motion diagram by specifying a precise **position** value on the vertical axis in addition to time on the horizontal axis. The line of best fit indicates the object's speed, as well as if it is accelerating or decelerating.
<img src="/resources/images/position-time-graph.png" width=700>(Source: Kognity)</img>
When the slope is:
- linear, the object is moving at a constant speed.
- exponential, the object is accelerating.
- logarithmic, the object is decelerating.
## 2.2 - Forces
## 2.3 - Work, energy, and power
## 2.4 - Momentum and impulse
## 3.1 - Thermal concepts
## 3.2 - Modelling a gas
## Resources
- [IB Physics Data Booklet](/resources/g11/ib-physics-data-booklet.pdf)
- [IB SL Physics Syllabus](/resources/g11/ib-physics-syllabus.pdf)
- [Dealing with Uncertainties](/resources/g11/physics-uncertainties.pdf)
- [Linearising Data](/resources/g11/linearising-data.pdf)
- [External: IB Physics Notes](https://ibphysics.org)

View File

@ -1,76 +1,31 @@
site_name: Eifueo site_name: Eifueo
site_description: "A collection of personal notes throughout school"
site_author: "Daniel Chen"
copyright: "Text licensed under the GNU Free Documentation License"
site_url: "https://eifueo.eggworld.me"
repo_url: "https://git.eggworld.me/eggy/eifueo"
repo_name: Gitea
nav: nav:
- Home: index.md - Home: index.md
- Grade 11 IB: - SL Physics A: sph3u7.md
- SL Physics 1: g11/sph3u7.md - HL Chemistry A: sch3uz.md
- SL Physics 2: g11/sph4u7.md - SL Math - Analysis and Approaches A: mhf4u7.md
- SL Math - Analysis and Approaches 1: g11/mhf4u7.md - HL English A: eng3uz.md
- SL Math - Analysis and Approaches 2: g11/mcv4u7.md - IB Resources: resources.md
- SL French 1: g11/fsf3u7.md
- HL English 1: g11/eng3uz.md
- HL Chemistry 1: g11/sch3uz.md
- HL History 1: g11/chw3mz.md
- Theory of Knowledge: g11/tok.md
- Grade 12 IB:
- SL French 2: g12/fsf3uz.md
- HL Chemistry 2: g12/sch4uz.md
- HL Chemistry 3: g12/snc4mz.md
- HL English 2: g12/eng4uz.md
- HL History 2: g12/chy4uz.md
- Computer Engineering 1A:
- "ECE 105: Classical Mechanics": 1a/ece105.md
- "ECE 150: C++": 1a/ece150.md
- "MATH 115: Linear Algebra": 1a/math115.md
- "MATH 117: Calculus 1": 1a/math117.md
- Computer Engineering 1B:
- "ECE 106: Electricity & Magnets": 1b/ece106.md
- "ECE 108: Discrete Math 1": 1b/ece108.md
- "ECE 124: Digital Circuits": 1b/ece124.md
- "ECE 140: Linear Circuits": 1b/ece140.md
- "ECE 192: Engineering Economics": 1b/ece192.md
- "MATH 119: Calculus 2": 1b/math119.md
- Computer Engineering 2A:
- "ECE 109: Materials Chemistry": 2a/ece109.md
- "ECE 240: Electronic Circuits": 2a/ece240.md
- "ECE 222: Digital Computers": 2a/ece222.md
- "ECE 250: DSA": 2a/ece250.md
- "ECE 205: Advanced Calculus 1": 2a/ece205.md
- "ECE 204: Numerical Methods": 2a/ece204.md
- Computer Engineering 2B:
- "ECE 208: Discrete Math 2": 2b/ece208.md
- "ECE 207: Signals": 2b/ece207.md
- "BIOL 240: Microbiology 1": 2b/biol240.md
- "ECE 203: Probability": 2b/ece203.md
- "ECE 224: Embedded": 2b/ece224.md
- "ECE 252: Concurrency": 2b/ece252.md
theme: theme:
name: material name: material
markdown_extensions: markdown_extensions:
- mdx_math: - mdx_math:
add_preview: True
enable_dollar_delimiter: True enable_dollar_delimiter: True
- admonition - admonition
- pymdownx.details - pymdownx.details
- pymdownx.superfences - pymdownx.superfences
- attr_list
- def_list
- footnotes
- toc:
permalink: True
extra_javascript: #extra_css: [
[ # 'https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css'
"https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.2/katex.min.js", #]
"https://cdn.jsdelivr.net/npm/katex@0.16.2/dist/contrib/mhchem.min.js",
"https://cdn.jsdelivr.net/npm/katex/dist/contrib/mathtex-script-type.min.js",
]
extra_css: extra_javascript: [
["https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.2/katex.min.css", "fix_katex.css"] # 'https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js',
# 'https://cdn.jsdelivr.net/npm/katex/dist/contrib/mathtex-script-type.min.js'
#]
'https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js',
'mathjax-config.js'
]

View File

@ -1,6 +0,0 @@
mkdocs
mkdocs-material
mkdocs-material-extensions
# get latest commit bc pypi is outdated and is missing some fixes
git+https://github.com/oprypin/markdown-callouts.git#egg=markdown-callouts