used mdframe for 1st and it worked, and in the second it eats it up.
Here is the latex code:
\documentclass [10pt]{ article}
\usepackage[utf8]{ inputenc}
\usepackage[croatian]{babel}
\usepackage{amsfonts}
\usepackage{color}
\usepackage{amsmath}
\usepackage{mdframed}
\DeclareMathOperator{\tg}{tg}
\DeclareMathOperator{\ctg}{ctg}
\title{LaTeX vježbe-5}
\author{Dino Luinović}
\date{30.10.2017}
\begin{document}
\maketitle
\pagenumbering{gobble}
\newpage
\pagenumbering{arabic}
\newtheorem{zadatak}{Zadatak}[section]
\begin{mdframed}
\section{Derivacija}
\subsection{Tehnika deriviranja}
\textbf{Definicija:} Neka je $f:I\rightarrow\mathbb{R}$ funkcija, $I\subseteq\mathbb{R}$ otvoreni interval i $c\in I$.Kažemo da je $f$ derivabilna u $c$ ako postoji\\
\begin{equation}\label{derlim}
\lim_{x \to c}\frac{f(x)-f(c)}{x-c}\\
\end{equation}
i taj limes označimo s $f'(c).$
\begin{zadatak}
Koristeći definiciju $\left( {\color{red}\ref{derlim}} \right)$,
odredite derivaciju funkcije $ f(x)= \cos(x).$
\end{zadatak}
\textbf{Rješenje:}\\
\begin{align*}
f'(c) & = \lim_{x \to c}\frac{f(x)-f(c)}{x-c}\\
& = \lim_{x \to c}\frac{\sin(x)-\sin(c)}{x-c}\\
& = \lim_{x \to c}\frac{-2\sin(\frac{x+c}{2})\sin(\frac{x-c}{2})}{x-c}\\
& = -\sin c
\end{align*}\\
\begin{itemize}
\item[DZ:] Neka je $f(x)= \ln\left(\frac{x^2}{x-1}\right)$. Odredite:
\item[(a)] domenu funkcije $f$
\item[(b)] intervale monotonosti i ekstreme.
\end{itemize}
\end{mdframed}
\newpage
\begin{mdframed}
\section{Integral}
\subsection{Tablica Integrala}
\begin{table}[h]
\centering
\caption{Integrali}
\label{tab1}
\begin{tabular}{|l | l| c|}
\hline
$\int\ dx = x + C$ & $\int\frac{\,dx}{\cos^2 x}=\tg x + C$\\
\hline
$\int\ x^a {\,dx}=\frac{x^{a+1}}{a+1} + \ +C (a \neq -1)$
&$\int\frac{\,dx}{\sin^2 x}=-\ctg x+\ C$ \\
\hline
\end{tabular}
\end{table}
Tablica $\left( {\color{red}\ref{tab1}} \right)$ prikazuje integrale nekih funkcija.
\end{mdframed}
\section{Red}
\subsection{Taylorovi redovi}
U ovom području se zadaju naredbe za treću sekciju.
\section{Matrice}
A ovdje pišemo naredbe za sekciju Matrice.
\end{document}