Debian Codegraph @

texmf-dist/doc/latex/exsol/example.tex

raw
1 %%
2 %% This is file `example.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% exsol.dtx (with options: `example')
8 %%
9 %% This is a generated file.
10 %%
11 %% Copyright (C) 2019 by Walter Daems <[email protected]>
12 %%
13 %% This file may be distributed and/or modified under the conditions of
14 %% the LaTeX Project Public License, either version 1.3 of this license
15 %% or (at your option) any later version. The latest version of this
16 %% license is in:
17 %%
18 %% http://www.latex-project.org/lppl.txt
19 %%
20 %% and version 1.3 or later is part of all distributions of LaTeX version
21 %% 2005/12/01 or later.
22 %%
23 \documentclass[a4paper,10pt]{article}
24
25 \usepackage{a4wide}
26 \usepackage[english]{babel}
27 \usepackage[copyexercisesinsolutions]{exsol}
28
29 \title{Gobal example, from the \textsf{ExSol} package}
30 \author{Walter Daems}
31 \setlength{\parindent}{0em}
32 \begin{document}
33 \maketitle
34
35 \section{Introduction}
36
37 In this text we explain how to solve second-order polynomial
38 equations.
39
40 \section{Solving second-order polynomial equations}
41
42 \begin{informulacollectiononly}
43 \section*{Solving second-order polynomial equations}
44 \end{informulacollectiononly}
45 \begin{informulacollection}
46 The roots of the following equation
47 \begin{equation}
48 a x^2 + bx + c = 0
49 \end{equation}
50 can be determined as:
51 \begin{equation}
52 x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}
53 \end{equation}
54 \end{informulacollection}
55
56 To make sure you master calculating the roots of second-order
57 equation, please solve exercise \ref{ex:1}.
58
59 \begin{exercises}[columns = 2]
60
61 \begin{exercise}
62 \label{ex:1}
63 Solve the following equation for $x \in C$, with $C$ the set of
64 complex numbers:
65 \begin{equation}
66 5 x^2 -3 x = 5
67 \end{equation}
68 \end{exercise}
69 \begin{solution}
70 Let's start by rearranging the equation, a bit:
71 \begin{eqnarray}
72 5.7 x^2 - 3.1 x &=& 5.3\\
73 5.7 x^2 - 3.1 x -5.3 &=& 0
74 \end{eqnarray}
75 The equation is now in the standard form:
76 \begin{equation}
77 a x^2 + b x + c = 0
78 \end{equation}
79 For quadratic equations in the standard form, we know that two
80 solutions exist:
81 \begin{equation}
82 x_{1,2} = \frac{ -b \pm \sqrt{d}}{2a}
83 \end{equation}
84 with
85 \begin{equation}
86 d = b^2 - 4 a c
87 \end{equation}
88 If we apply this to our case, we obtain:
89 \begin{equation}
90 d = (-3.1)^2 - 4 \cdot 5.7 \cdot (-5.3) = 130.45
91 \end{equation}
92 and
93 \begin{eqnarray}
94 x_1 &=& \frac{3.1 + \sqrt{130.45}}{11.4} = 1.27\\
95 x_2 &=& \frac{3.1 - \sqrt{130.45}}{11.4} = -0.73
96 \end{eqnarray}
97 The proposed values $x = x_1, x_2$ are solutions to the given equation.
98 \end{solution}
99 \begin{exercise}
100 \label{ex:2}
101 Consider a 2-dimensional vector space equipped with a Euclidean
102 distance function. Given a right-angled triangle, with the sides
103 $A$ and $B$ adjacent to the right angle having lengths, $3$ and
104 $4$, calculate the length of the hypotenuse, labeled $C$.
105 \end{exercise}
106 \begin{solution}
107 This calls for application of Pythagoras' theorem, which
108 tells us:
109 \begin{equation}
110 \left\|A\right\|^2 + \left\|B\right\|^2 = \left\|C\right\|^2
111 \end{equation}
112 and therefore:
113 \begin{eqnarray}
114 \left\|C\right\|
115 &=& \sqrt{\left\|A\right\|^2 + \left\|B\right\|^2}\\
116 &=& \sqrt{3^2 + 4^2}\\
117 &=& \sqrt{25} = 5
118 \end{eqnarray}
119 Therefore, the length of the hypotenuse equals $5$.
120 \end{solution}
121 \end{exercises}
122
123 And now, we can come to the conclusion.
124 \section{Conclusion}
125 Solving second-order polynomial equations is very easy.
126 \end{document}
127 \endinput
128 %%
129 %% End of file `example.tex'.