<reponame>Jorengarenar/homework
% LaTeX
% vim: fen

\documentclass[12pt]{article}

\usepackage[a4paper, vmargin=10pt, hmargin=50pt, head=16pt, includehead]{geometry}
\usepackage[T1]{fontenc} % for UTF characters
\usepackage{amsmath}     % math
\usepackage{amssymb}     % math symbols
\usepackage{charter}     % (partially) fixes unserchable PDF
\usepackage{enumitem}    % enumerate/list items
\usepackage{fancyhdr}    % header
\usepackage{mathtools}   % math tools
\usepackage{multicol}    % multiple columns
\usepackage{titlesec}    % alternative section titles
\usepackage{xcolor}      % color text

\newcommand{\degree}{^{\circ}}
\newcommand{\for}{\ \leftrightarrow\ }
\newcommand{\Integral}[4]{\int_{#1}^{#2} \! #3 \, \mathrm{d}#4}
\newcommand{\mathcolorbox}[2]{\colorbox{#1}{$\displaystyle #2$}}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\newcommand{\qed}{\textbf{\textit{QED}}}
\newcommand{\qef}{\textbf{\textit{QEF}}}
\newcommand{\task}[1]{\textbf{ #1}}

\let\oldref\ref \renewcommand{\ref}[1]{\mathrm{(\oldref{#1})}}

\DeclareMathOperator{\?}{?}
\DeclareMathOperator{\dom}{dom}
\DeclareMathOperator{\im}{im}
\DeclareMathOperator{\lin}{lin}
\DeclareMathOperator{\R}{\mathbb{R}}
\DeclareMathOperator{\sgn}{sgn}

\let\oldepsilon\epsilon \renewcommand{\epsilon}{\varepsilon}

\counterwithin*{equation}{section}  % reset equation counter after each section
\titleformat{\section}{\normalfont\Large\bfseries}{}{0pt}{} % remove section numbering

\newcommand{\sectionbreak}{\clearpage} % start each section on new page

\setlength{\parskip}{0.7em}

\pagestyle{fancy}
\lhead{<NAME>}
\chead{Zestaw 12}
\let\Sectionmark\sectionmark
\def\sectionmark#1{\def\Sectionname{#1}\Sectionmark{#1}}
\rhead{}

\begin{document}
\section{Zadanie 3c}
\task{Korzystając z definicji całki oznaczonej uzasadnić równość }
\[ \lim_{n \to \infty} \left( \frac{1}{3n+1} + \frac{1}{3n+2} + ... + \frac{1}{3n + n} \right) = \ln{\frac{3}{4}} \]

Definicja całki oznaczonej wg Riemanna:

\[ \Integral{a}{b}{f(x)}{x} := \lim_{\delta(\mathcal{P}) \to 0} \sum_{k=1}^n f(x_k^*) \Delta x_k\]

Przekształcenia granicy:
\begin{gather*}
    \lim_{n \to \infty} \left( \frac{1}{3n+1} + \frac{1}{3n+2} + ... + \frac{1}{3n + n} \right) =
    \lim_{n \to \infty} \sum_{k = 1}^n \frac{1}{3n + k} =
    \lim_{n \to \infty} \sum_{k = 1}^n \left( \frac{3n}{3n + k} \cdot \frac{1}{3n} \right) =\\
    = \lim_{n \to \infty} \sum_{k = 1}^n \left( f(\frac{3n + k}{3n}) \cdot \frac{1}{3n} \right)
    \for f(x) = \frac{1}{x}
\end{gather*}

\begin{equation*}
    \left.
    \begin{aligned}
        & \lim_{n \to \infty} \sum_{k = 1}^n \left( f(\frac{3n + k}{3n}) \cdot \frac{1}{3n} \right) =
        \lim_{n \to \infty} \sum_{k = 1}^n \left( f(1 + \frac{1}{3n}k) \cdot \frac{1}{3n} \right)
        \implies \qquad \\ & \implies
        \left\{ \begin{array}{l}
            a = 1 \\
            \Delta x = \frac{1}{3n}
        \end{array} \right.
        \implies \frac{b - 1}{n} = \frac{1}{3} \implies b = \frac{4}{3}
    \end{aligned}
    \right\}
    \implies
\end{equation*}

\begin{equation*}
    \implies
    \lim_{n \to \infty} \left( \frac{1}{3n+1} + \frac{1}{3n+2} + ... + \frac{1}{3n + n} \right) =
    \Integral{1}{\frac{4}{3}}{\frac{1}{x}}{x}
\end{equation*}

\begin{equation*}
    \Integral{1}{\frac{4}{3}}{\frac{1}{x}}{x} =
    \ln{\frac{4}{3}} - \ln{1} =
    \ln{\frac{4}{3}} - 0 =
    \ln{\frac{4}{3}} = \implies
\end{equation*}

\begin{equation*}
    \implies
    \lim_{n \to \infty} \left( \frac{1}{3n+1} + \frac{1}{3n+2} + ... + \frac{1}{3n + n} \right) =
    \ln{\frac{4}{3}}
\end{equation*}

\[ \qed \]

\section{Zadanie 6a}
\task{Oblicz } $ \displaystyle \Integral{-2}{2}{\sgn(x-x^2)}{x} $

\begin{align*}
    \displaystyle \Integral{-2}{2}{\sgn(x-x^2)}{x} &=
    \Integral{-2}{0}{\sgn(x-x^2)}{x} + \Integral{0}{1}{\sgn(x-x^2)}{x} + \Integral{1}{2}{\sgn(x-x^2)}{x} =\\
    &= \Integral{-2}{0}{-1}{x} + \Integral{0}{1}{1}{x} + \Integral{1}{2}{-1}{x} =\\
    &= \Integral{0}{1}{1}{x} - \Integral{-2}{0}{1}{x} - \Integral{1}{2}{1}{x} =\\
    &= \left. x\right|_0^1 - \left. x\right|_{-2}^0 - \left. x\right|_1^2 =\\
    &= (1 - 0) - (0 - (-2)) - (1 - 2) =\\
    &= 1 - 2 + 1 =\\
    &= 0
\end{align*}

\section{Zadanie 7b}
\task{Oszacuj } $ \displaystyle \Integral{0}{\pi}{\frac{1}{100 - 2 \sin^2{x}}}{x} $

$ $

Metoda prostokątów:

\begin{equation*}
    \Integral{a}{b}{f(x)}{x} \approx \Delta x (y_0 + y_1 + ... + y_{n-1})
    \for
    \left\{ \begin{array}{l}
        \displaystyle \Delta x = \frac{b - a}{n} \\[0.5em]
        y_k = f(a + k \Delta x)
    \end{array} \right.
\end{equation*}

Niech $n = 6$, zatem

\begin{itemize}
    \item[] $ \displaystyle f(x) = \frac{1}{100 - 2 \sin^2{x}} $
    \item[] $ \displaystyle \Delta x = \frac{\pi - 0}{n} = \frac{\pi}{6} $
    \item[] $ y_k = f(0 + k \Delta x) = f(k \Delta x) $
    \item[]
        \begin{multicols}{2}
            \begin{itemize}
                \item[] $ \displaystyle y_0 = f(0 \frac{\pi}{6}) = f(0) = \frac{1}{100}$
                \item[] $ \displaystyle y_1 = f(\frac{\pi}{6}) = \frac{1}{100 - \frac{1}{2}} $
                \item[] $ \displaystyle y_2 = f(\frac{\pi}{3}) = \frac{1}{100 - \frac{3}{2}} $
                \item[] $ \displaystyle y_3 = f(\frac{\pi}{2}) = \frac{1}{100 - 2} $
                \item[] $ \displaystyle y_4 = f(\frac{2\pi}{3}) = \frac{1}{100 - \frac{3}{2}} $
                \item[] $ \displaystyle y_5 = f(\frac{5\pi}{6}) = \frac{1}{100 - \frac{1}{2}} $
            \end{itemize}
        \end{multicols}
    \item[] $ y_0 + y_1 + ... + y_{n-1} = \frac{1}{100} + \frac{2}{100-\frac{1}{2}} + \frac{2}{100-\frac{3}{2}} + \frac{1}{100-2} = \frac{11642697}{192094700} $
\end{itemize}

Stąd:
\begin{equation*}
    \Delta x (y_0 + y_1 + ... + y_{n-1}) = \frac{\pi}{6} \frac{11642697}{192094700} = \frac{3880899}{384189400}\pi
\end{equation*}

Podsumowując:
\begin{equation*}
    \Integral{0}{\pi}{\frac{1}{100 - 2 \sin^2{x}}}{x} \approx \frac{3880899}{384189400}\pi
\end{equation*}

\end{document}
