You could use the notable limits :
$\lim\limits_{t\to0}\dfrac{\ln(1+t)}t=1\;\,,\quad$ $\lim\limits_{x\to0}\dfrac{\sin x}x=1\;.\quad\color{blue}{(*)}$
Now, we will calculate your limit by using $\,(*)\,$:
$\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x\right)+\ln\left(1+x^2-x\right)}{\sec x-\cos x}=$
$=\lim\limits_{x\to0}\dfrac{\ln\left[\left(1+x^2+x\right)\left(1+x^2-x\right)\right]}{\sec x-\cos x}=$
$=\lim\limits_{x\to0}\dfrac{\ln\big[\left(1+x^2\right)^2-x^2\big]}{\sec x-\cos x}=\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)}{\sec x-\cos x}=$
$=\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)}{\frac1{\cos x}-\cos x}=\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)\!\cdot\!\cos x}{1-\cos^2\!x}=$
$=\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)\!\cdot\!\cos x}{\sin^2\!x}=$
$=\lim\limits_{x\to0}\left[\dfrac{\ln\left(1+x^2+x^4\right)}{x^2+x^4}\!\cdot\!\dfrac{x^2\left(1+x^2\right)\cos x}{\sin^2\!x}\right]=$
$=\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)}{x^2+x^4}\!\cdot\!\lim\limits_{x\to0}\left(\!\dfrac x{\sin x}\!\right)^2\!\!\cdot\lim\limits_{x\to0}\big[\!\left(1+x^2\right)\cos x\big]=$
$=\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)}{x^2+x^4}\!\cdot\!1^2\!\cdot\!1=\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)}{x^2+x^4}\,.$
By letting $\;t=x^2+x^4\,,\;$ it follows that $\;t\to0\;$ as $\;x\to0\;$ and consequently we get that
$\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)}{x^2+x^4}=\lim\limits_{t\to0}\dfrac{\ln(1+t)}t=1\,.$
Addendum :
It is wrong to calculate your limit in the following way :
$\lim\limits_{x\to0}\dfrac{\left(x^2+x\right)\frac{\ln\left(1+x^2+x\right)}{x^2+x}+\left(x^2-x\right)\frac{\ln\left(1+x^2-x\right)}{x^2-x}}{\sec x-\cos x}=$
$=\lim\limits_{x\to0}\dfrac{\left(x^2+x\right)\!\cdot\!1+\left(x^2-x\right)\!\cdot\!1}{\sec x-\cos x}=$
$=\lim\limits_{x\to0}\dfrac{\left(x^2+x\right)+\left(x^2-x\right)}{\sec x-\cos x}\,.$
It is wrong because you have calculated the limit of just a part of the function without using any theorem about the calculation of limits.
I have calculated the limit of a part of the function too when I wrote that
$\lim\limits_{x\to0}\left[\dfrac{\ln\left(1+x^2+x^4\right)}{x^2+x^4}\!\cdot\!\dfrac{x^2\left(1+x^2\right)\cos x}{\sin^2\!x}\right]=$
$=\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)}{x^2+x^4}\!\cdot\!\lim\limits_{x\to0}\left(\!\dfrac x{\sin x}\!\right)^2\!\!\cdot\lim\limits_{x\to0}\big[\!\left(1+x^2\right)\cos x\big]=$
$=\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)}{x^2+x^4}\!\cdot\!1^2\!\cdot\!1=\lim\limits_{x\to0}\dfrac{\ln\left(1+x^2+x^4\right)}{x^2+x^4}\,,$
but what I did is correct because I applied the theorem that states that the limit of a product is equal to the product of the limits (unless there is the indeterminate form $0\!\cdot\!\infty$).
But which theorem have you applied in your method that you called “way 1” ?
cos x→ $cos x$ versus\cos x→ $\cos x.$ – CiaPan Aug 28 '23 at 11:08