问:
Signed (Riemann) sums
Thinking about Riemann's rearrangement theorem, I asked myself the following question: for any real number $\alpha >1$ fixed, are there two integers $1 \leqslant M < N$ and a sequence $(\varepsilon_n)_n \in \{-1,0,1\}^{\mathbb{N}}$ such that
$$ \sum_{k=M+1}^N \frac{\varepsilon_k}{k^{\alpha}} = \frac{1}{M^{\alpha}} \, ? $$

I have tried to bound the sum as in the proof of the series-integral theorem, but it doesn't seem to be enough. For example, by taking $\alpha=2$, $M=5$ and $N=12$, the sum exceeds the right member ... But is it possible to have equality?

It seemed obvious to me that it is not, but I can't prove it. Do you have an idea please?
Thank you in advance! :)

答: Have a look at this (beautiful) paper, it gives some interesting conditions. For example, corollary $A$ shows that for $\alpha = 2$, there are actually loads of solutions.

Title: Signed (Riemann) sums


问:
Do we have $u^2 \leq u$ when $\|u \| \leq 1$ in a $C^*$-algebra?
Let $u$ be a positive element in a $C^*$-algebra $A$ with $\|u \|\le 1$. Then is it true that $u^2 \leq u$?

Attempt: This is true in the commutative $C^*$-subalgebra $C^*(u)$, since by the Gelfand-Naimark theorem, $C^*(u) \cong C_0(X)$ where $X$ is some locally compact Hausdorff space. Thus, this also holds in $A$ since positivity does not depend on the ambenient $C^*$-subalgebra.

Is this correct?

答:
From $u$ positive and $\|u\|\leq1$, you get $0\leq u\leq 1$. Also, being positive, $u$ has a (unique) positive square root.

Then
$$
u-u^2=u^{1/2}(1-u)u^{1/2}\geq0.
$$

ContentLicense: CC BY-SA 4.0


问:
What class of Lie groups embed in a general linear group?
It’s a non trivial fact that every compact Lie groups embeds as a subgroup of SO(n), what larger class of Lie groups can one consider that necessarily embeds in GL(n)?
Possibly locally compact or finitely generated+ some condition. I know residual finite + finitely generated is insufficient.</p>

答:
This is a partial answer that only applies to connected groups.

Every Lie algebra embeds into the lie algebra $\mathfrak{gl}(n)$ for some $n$. This is Ado's theorem. So for every Lie algebra there is at least one Lie group with that Lie algebra embedding into $GL(n)$.

Because of the relation between different connected Lie groups with the same Lie algebra $\mathfrak{g}$ (they are all quotients of their joint universal covering group $\tilde{G}$ by discrete subgroups $S$ of the center $Z$ of $\tilde{G}$) it is a topological matter. The fundamental group of $G := \tilde{G}/S$ is, if I am not crazy, isomorphic to $S$ and is hence enough to single out $G$ from its locally-but-not-necessarily-globaly isomorphic brothers and sisters.

Now whether the Lie-algebra embedding of $\mathfrak{g}$ into $\mathfrak{gl}(n)$ globalizes to a Lie group embedding of $G$ into $GL(n)$ depends only on if the fundamental group of $G$ is 'compatible' with the fundamental group of $GL(n)$, but I forgot the precise notion of compatibility here.


问:
How to find linear transformation with given kernel
Find a linear transformation from $\mathbb{R}^3 \to \mathbb{R}^3$ such that whose kernel is $xy$ plane.

Can you kindly explain it?

答:
Hint: Your question is equivalent to find a linear transformation $T: \mathbb{R}^{3} \to \mathbb{R}^{3}$ such that $$\textbf{ker}(T)=\left\{\begin{pmatrix} x \\ y \\ z \end{pmatrix} \in \mathbb{R}^{3}: z=0, x,y \in \mathbb{R} \right\}$$
where $\textbf{ker}(T)$ is the kernel of the linear transformation $T$.

Solution and detailed explanation:

The operative way to find a correspondence rule for a linear transformation subject to certain restrictions is the following:

Find a base for the starting vector space, in such a way that it is known how the linear transformation acts on the elements of that chosen base.

Verify that the rank-nullity theorem holds.

Now,

Wee need to find a basis for $\mathbb{R}^{3}$ such that we know how $T$ acts on these elements. Now, since $\textbf{ker}(T)$ is a vector subspace of $\mathbb{R}^{3}$ (vector space starting.)
I'm sure, you can find since $$\textbf{ker}(T)=\left\{\begin{pmatrix} x \\ y \\ z \end{pmatrix} \in \mathbb{R}^{3}: z=0, x,y \in \mathbb{R} \right\}$$ so a basis for $\textbf{ker}(T)$ is $$\beta_{\ker(T)}=\left\{\begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}, \begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix} \right\} \implies \dim(ker(T))=2.$$

Now, we need a basis for $\mathbb{R}^{3}$ so, we can choose $$\beta=\left\{\begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}, \begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}, \color{blue}{\begin{pmatrix} 0 \\ 0 \\ 1  \end{pmatrix}} \right\}$$
where we can CHOOSE $$T\begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}= \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} \not= \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$$

Note that $$T\begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}, \quad T\begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}= \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}, \quad \text{and} \quad T\begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} $$
then we know how $T$ acts ON the elements of the basis that we select for the starting vector space (domain of $T$).

Now, constructing the correspondence rule for $T$ becomes a computational detail problem.

Let $\begin{pmatrix} a \\ b \\  c \end{pmatrix} \in \mathbb{R}^{3}$ such that $$\begin{pmatrix} a \\ b \\ c \end{pmatrix}=\alpha_{1} \begin{pmatrix} 1\\ 0 \\ 0 \end{pmatrix}+\alpha_{2}\begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix} +\alpha_{3}\begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}$$
solve it, you can find $\alpha_{1}=a, \alpha_{2}=b, \alpha_{3}=c$, so by property of linearity, "you can apply $T$ to both sides of the equality", then $$T\begin{pmatrix} a \\ b \\ c \end{pmatrix} =aT\begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}+b T\begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}+ cT\begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}$$
using the hypothesis, you can fint that $$\boxed{T\begin{pmatrix} a \\ b \\ c \end{pmatrix} =\begin{pmatrix} 0 \\ 0 \\ c \end{pmatrix}}$$

also, you can see that $$\dim(ker(T))+\dim(im(T))=\dim(\mathbb{R}^{3})$$ and the kernel of $T$ is the $xy$-plane.

Note: My intention with this detailed solution is to show future readers on MathSE a general help in solving problems on construction of linear transformation with conditions for construction.


答: The kernel is the set of elements that are sent to zero by the map. Since we are dealing with a linear map, we only need to consider the basis vectors for $\mathbb{R}^3$, namely the set $\{(1,0,0),(0,1,0),(0,0,1)\}$. We want linear combinations of the first two vectors to be sent to 0, so we know that the first two columns of the matrix representation of the linear map should be all zeros. Then, the simplest thing to do to make sure we don't send any more elements to zero, just let the last column denote the identity map,  so in the standard representation let the final column be $(0,0,1)^T$.

Title: How to find linear transformation with given kernel

Body:
Find a linear transformation from $\mathbb{R}^3 \to \mathbb{R}^3$ such that whose kernel is $xy$ plane.

Can you kindly explain it?


问:
Trees and leaf: Graph Theory
Let T be a tree with at least two vertices and let $v \in V(T)$. If T-v is a tree, then v is a leaf.

Attempt: Let T be a tree and let v be a leaf of T. Then T-v is a tree.

Let $a,b \in V(T-v)$. We must show that there is an (a,b) path in T-v. We know that since T is connected, there is (a,b)-path P in T. I claim that O does not include the vertex v. Since v is neither the first nor the last vertex on this path, it has two distinct neighbors on the path, contradicting the fact that $d(v)=1.$ Therefore P is an (a,b)-path in t-v and T-v is connected and a tree.

I just proved the converse of my original question. But a little stuck proving original question.

答:
Do you know that a tree of $n$ vertices has $n-1$ edges?

If so, then suppose $T$ has $n$ vertices (and hence $n-1$ edges).  Then $T-v$ has $n-1$ vertices and $n-1-\mathrm{deg}(v)$ edges.  Hence, if $T-v$ is a tree, then $\mathrm{deg}(v)=1$.

ContentLicense: CC BY-SA 3.0

Title: Trees and leaf: Graph Theory


问:
Basic multivariate calculus question
Suppose we have a function of 3 variables, a, b, and c, f(a(x,y,z), b(x,y,z), c(x,y,z)). a, b, and c are each functions of x, y, z.

If I wanted the partial derivative of f with respect to x, would it be the following:

(∂f/∂a)(∂a/∂x) + (∂f/∂b)(∂b/∂x) + (∂f/∂c)*(∂c/∂x)

答: That's right. There are several different notations for this scenario (see here for example), but the end result is the same, and it's what you had indicated.</p>

Title: Basic multivariate calculus question


问:
Integration by recurrence relation
For an integer $n \ge 0$, define

$I_n = \int_0^{\pi/8}\cos^{n+1}(2x)dx$.
Find a recurrence relation $I_n$ and $I_{n-2}$.

If someone could just give me a few hints in order to start this question. I don't want a solution just some hints so that I can figure it out myself, thank you.

答:
You'll want to double-check all my arithmetic, but:

Integrating by parts with $u:=\cos^n(2x),\,v:=\tfrac12\sin(2x)$,$$I_n=2^{-(n+3)/2}+\int_0^{\pi/8}n\cos^{n-1}(2x)\sin^2(2x)dx=2^{-(n+3)/2}+n(I_{n-2}-I_n),$$since $\sin^2(2x)=1-\cos^2(2x)$. Rearranging, $I_n=\frac{nI_{n-2}+2^{-(n+3)/2}}{n+1}$.

Title: Integration by recurrence relation


问:
Find the domain of a parametric equation

Find the parametric equation for $x^2-y^2=1$, $x>0$ $y \in [-1, 1]$
and $z \in [0,1]$. Write the integral to find the area without
calculating it.

The parametric equation I found (using the identity $\cosh^2t - \sinh^2 t = 1)$ for the given equation is $\phi(t,z)=(\cosh{t}, \sinh{t}, z)$, but now I'm having problems when setting up the integral:

$\int _{0} ^{1} \int _{?} ^{?} ||\phi_t(t,z) \times \phi_z(t,z)|| = \int _{0} ^{1} \int _{?} ^{?} \sqrt{\cosh^2t+\sinh^2t} dtdz$

I really don't know how to find the domain for $t$...

答: The domain is determined by the substitutions you have made, namely, $x = cosh(t), y = sinh(t)$. Thus, you have to determine the domain's endpoints by solving $-1 = sinh(t)$ and $1 = sinh(t)$ for $t$.


问:
Can a Test of Means replace a Test of Proportions?
I have 50 days of data of conversion rates for my company. For these 50 days, I have two samples: Control and Test. I have manipulated it to look like the below, with each day being an observation (n=50):

Date               Control     Test

9/1/2020       2.50%     2.67%

9/2/2020       2.85%     2.49%

9/3/2020       2.10%     2.12%

9/4/2020       2.34%     3.00%

...

I want to know if the conversion rate for the Test Sample is statistically different than the conversion for the Control Sample.

I also have the inputs for these conversion rates for each day. That is, for 9/1/2020, I know there were 1,000 observations for the Control and 25 conversions, yielding a 2.50% conversion rate. And for the Test on 9/1/2020, I know that there were 1,500 observations and 40 conversions, yielding a 2.67% conversion rate. I know this information for all 50 days for both samples.

When I look at this problem, I am unsure of whether to use a test of proportion or a test of means. Yes, conversion rate is a proportion, but when I put the data into the above format (with each row having a conversion rate), I feel like I could just as easily perform a test of means.

For example, for the 50 observations, the mean Conversion Rate for the Control is 2.49% and the mean Conversion Rate for the Test is 2.58%. Using these figures and the standard deviation, I can calculate a means t-test to see if the two samples have statistically significant differences in their means.

However, I could just as easily run a Proportions Test, using the inputs into conversion each conversion rate.

For the Test:       Observations = 57,034 | Conversions = 1,475, yields 2.59% conversion rate
For the Control:    Observations = 99,282 | Conversions = 2,489, yield  2.51% conversion rate

My question is how do I know which to use and what I am gaining/ losing by choosing one over the other? When I run these scenarios in R, I do get different answers, and I am struggling to understand why the difference exists and which is the right method.

Ultimately, it seems like you could convert any test of proportions into a test of means if you really wanted to, just taking the average of the proportions, but this can't be right.

Would greatly appreciate any help on this! Thanks in advance!

答:
You can do both tests assuming you have statistical software and should get qualitatively similar results, although not necessarily identical.

That's because due to the large daily sample sizes, the observed conversion rates are approximately normally distributed. However, since the sample sizes for each day are probably different in each group, the assumption of constant standard deviation for the daily conversion rates for each group is most likely not even approximately satisfied. Think weekends vs. weekdays. That could explain the observed discrepancies.

If it's correct to assume that (a) conversion rates did not change from day to day in each group and (b) outcomes are independent, then it's best to use a proportions test for the overall data for each group. Technically speaking, these four numbers (observations and conversions for both groups) make up a sufficient statistic. In that case you can use Fisher's exact test or simply the proportions test.


问:
Good estimator of $p$ knowing $\operatorname{Bin}(2,p)$
We consider the statistical sample ${1,0,2,1,1,0,1,0,0}$ and we assume that the values of this sample come from a binomial distribution $\operatorname{Bin}(2, p)$.

How can we estimate the value of $p$?

For me, an intuitive estimator is $\hat{p} = \frac{1}{n}\sum_{i=1}^n X_i$. So $\hat{p}$ should be just $\frac{2}{3}$. Where am I wrong?

答: Your "intuitive estimator" is an unbiased estimator of the mean of a random variable.  But the mean of $\text{Bin}(n,p)$ is $np$, and you want $p$.


问:
Distribution of $ \tan \theta$ when $\theta$ is uniform on $[0,2\pi)$
Suppose you have $X$ and $Y$, which are two random variables whose joint distribution is the standard Gaussian distribution. Let random variables $R \geq 0 $ and $\theta \in [0, 2 \pi)$ satisfy: $X=R\cos\theta$ and $Y=R\sin\theta$.

Let $Z=\frac{Y}{X}$.

Thus, to find the density of $Z$, I did:
$Z= \tan \theta$.

And so, $$F_Z(z)=P(Z\leq z) = P(\tan \theta \leq z) = P( \theta \leq \arctan z)$$

Since $ \theta\sim \text{Uniform} [0, 2\pi)$ due to the fact that $X$ and $Y$ are standard Gaussian and deducing the distribution of $\theta$ from the joint distribution of $ R$ and $ \theta $, we get that this is equal to:

$ \int_{0}^{\arctan z} \frac{1}{2} dt$, which then works out to be equal to $\frac{\arctan(z)}{2} $.

After differentiating this to obtain the density function of $Z$, I get:

$$ f_Z(z)= \frac{1}{2\pi(1+{z^2})}$$

I am not sure about what the limits of $Z$ or $\theta$ should now be.

Any feedback will be appreciated.

答:
Let's think about this for a bit.  First, we have to consider what values $Z = Y/X$ may take on for $(X,Y) \in \mathbb R^2$.  Suppose $X > 0$.  Then $Z = Y/X \propto Y$ and so $Z \in \mathbb R$.

Now when we perform the transformation $Z = \tan \theta$, and $\theta \in [0,2\pi)$, this induces some discontinuity because, for instance, $\theta = \pi/2$ leads to $Z$ being undefined, but then $\theta = \pi/2 + 0.01$ gives $Z < 0$.  So we need to be a bit more careful.  For this reason we cannot simply write $$\Pr[\tan \theta \le z] = \Pr[\theta \le \tan^{-1} z].$$  Concretely, if we set $z = 1$, then the inequality $\tan \theta \le 1$ on $\theta \in [0, 2\pi)$ leads to the set $$\theta \in [0, \pi/4] \cup (\pi/2, 5\pi/4] \cup (3\pi/2, 2\pi)$$ and consequently $$\Pr[\tan \theta \le 1] = \frac{3}{4}.$$  This example actually illustrates how we should compute the correct probability.

We can see from the graph of $\tan \theta$ on $[0,2\pi)$ that the desired probability is simply twice the length of the interval within the subset $\theta \in (\pi/2, 3\pi/2)$ that satisfies $\tan \theta \le z$; i.e., $$\Pr[\tan \theta \le z] = 2 \Pr[\pi/2 < \theta \le \pi + \tan^{-1} z]$$ where we take $\tan^{-1} z \in (-\pi/2, \pi/2)$.  This gives us $$F_Z(z) = 2 \frac{\pi + \tan^{-1} z - \pi/2}{2\pi} = \frac{1}{2} + \frac{\tan^{-1} z}{\pi}, \quad -\infty < z < \infty.$$  And now this CDF looks nice and monotone, and satisfies $F_Z(-\infty) = 0$ and $F_Z(\infty) = 1$ whereas yours did not.  The density is therefore $$f_Z(z) = \frac{1}{\pi(1+z^2)},$$ which integrates correctly to $1$ on $z \in (-\infty, \infty)$.  This is known as a Cauchy distribution.


问:
Question about uniform continuous proof.
If $f(x)$ define as: $f(x) = x\cos(\log(x))$, when $x  > 0$. $f(x) = 0$, when $x = 0$.
How we prove that $f$ is uniform continuous in $[0, +\infty[$?

答:
$ f $ is continuous at $ x=0$ since

$$(\forall x>0)\;|f(x)|\le |x|$$

$ f $ is differentiable at $ (0,+\infty) $ and

$$(\forall x>0)\;$$
$$f'(x)=\cos(\ln(x))-\sin(\ln(x))$$

thus
$$(\forall x>0)\;\;|f'(x)|\le 2$$

So, By MVT,
$$(\forall x,y\ge0)\;\;(\exists c>0) \;\;:$$
$$|f(x)-f(y)|=|x-y||f'(c)|$$
$$\le 2|x-y|$$

$ f $ is then UC at $ [0,+\infty)$.
You just can take $ \delta=\frac{\epsilon}{2}$.


问:
Finding the the number of Lattice paths with three steps.
We define a nice path of length as a path on a lattice from $(0,0)$ to $(n,n)$ such as every step in it is: $r=(0,1)$ , $u=(1,0)$ and $v=(1,2)$, and it does not go under the line $y=x$.

A. Write a formula for the generating function that counts the number of the nice paths.

B.Solve the above formula and find an expression for the number of these paths of length n.

C.Find the number of $(1,2)$ steps in all paths of length n.

I started with drawing the possible paths for $n=1,2,3,4$, getting that we have $1,3,9,27$ paths (respectively) if I did really succeed to count all the possible paths for each $n$.

So, then I concluded that each legal path (which is mentioned above) is:

Every path = $\epsilon$ or v(every path) u (every path) or r(every path) u (every path).

Whhere $\epsilon$ denote the empty path.

If $A(x)$ the generating function and x denote the number of steps then I get:

$A(x)=1+(xA(x))(xA(x))+(xA(x))(xA(x))$.
$A(x)=1+x^2A(x)^2+x^2A(x)^2$

In B. I can do this after extracting $A(x)$
With finding the coefficient of $x^n$ in $A(x)$.

C. I don't understand if this is related to statistics on the number of (1,2) steps..

I'm not sure if my way of thinking is correct or not, I discovered that my way is not accurate. I'll be glad if you can correct me, and explain it.

答:
We derive a generating function $A(t)$ where $[t^n]A(t)$, the coefficient of $t^n$ in $A(t)$ gives the number of nice paths from $(0,0)$ to $(n,n)$. We conveniently  encode a step in $x$-direction as $x$ corresponding to $u=(1,0)$, a step in $y$-direction as $y$ corresponding to $r=(0,1)$ and encode written in parenthesis $(xy^2)$ a step corresponding to $v=(1,2)$.

We consider the following symbolic equation
\begin{align*}
\mathcal{A}=\varepsilon + t\times\mathcal{A}\times\mathcal{A}+t^2\times\mathcal{A}\times\mathcal{A}\tag{1}
\end{align*}

and interpret (1) as the set $\mathcal{A}$ of nice paths which is built from

the empty path or

a diagonal step of length $1$,  which is realised as $yAxA$ where $A$ represents a nice path or

a diagonal step of length $2$, which is realised as $(xy^2)AxA$ where $A$ represents a nice path.

The idea here is to consider the diagonal step $yx$ with length $1$ and the diagonal step $(xy^2)x$ with length $2$ as basic building blocks.

From (1) we derive the functional equation
\begin{align*}
A(t)&=1+tA(t)^2+t^2A(t)^2\\
\end{align*}
and obtain the generating function
\begin{align*}
\color{blue}{A(t)}&\color{blue}{=\frac{1-\sqrt{1-4t-4t^2}}{2t(1+t)}}\\
&=1+t+3t^2+9t^3+\color{blue}{31}t^4+113t^5+431t^6+\cdots
\end{align*}
where the last line was calculated with some help of Wolfram Alpha.

The blue marked $31$ nice paths from $(0,0)$ to $(4,4)$ are
\begin{align*}
\begin{array}{llll}
yyyyxxxx&yyxxyxyx&(xy^2)yxxyx&yx(xy^2)xyx\\
yyyxyxxx&yxyyyxxx&(xy^2)xyyxx&yyx(xy^2)xx\\
yyyxxyxx&yxyyxyxx&(xy^2)xyxyx&yxy(xy^2)xx\\
yyyxxxyx&yxyyxxyx&y(xy^2)yxxx&yyxx(xy^2)x\\
yyxyyxxx&yxyxyyxx&y(xy^2)xyxx&yxyx(xy^2)x\\
yyxyxyxx&yxyxyxyx&y(xy^2)xxyx&(xy^2)(xy^2)xx\\
yyxyxxyx&(xy^2)yyxxx&yy(xy^2)xxx&(xy^2)x(xy^2)x\\
yyxxyyxx&(xy^2)yxyxx&yx(xy^2)yxx\\
\end{array}
\end{align*}

Note: The sequence $1,1,3,9,31,113,431,\dots$ is archived in OEIS as A052709.

We can also conveniently use the generating function $A(t)$ to obtain the number of $(1,2)$-steps which occur in the nice paths from $(0,0)$ to $(n,n)$. We mark the occurrence of an $(1,2)$-step, i.e. $(xy^2)$ in the symbolic equation (1) with $q$ and consider
\begin{align*}
\mathcal{A}_q=\varepsilon + t\times\mathcal{A}_q\times\mathcal{A}_q+q\cdot t^2\times\mathcal{A}_q\times\mathcal{A}_q\tag{2}
\end{align*}
We obtain from (2) the generating function
\begin{align*}
A(t;q)&=\frac{1-\sqrt{1-4t-4qt^2}}{2t(1+qt)}\\
&=1+t+(q+2)t^2+(4q+5)t^3+(\color{blue}{2q^2+15q+14})t^4\tag{3}\\
&\qquad+(15q^2+56q+42)t^5+\cdots
\end{align*}
and look at the polynomial $[t^4]A(t;q)=2q^2+15q+14$ which provides a refinement of the $31$ nice paths from $(0,0)$ to $(4,4)$. We have in accordance with the listed paths above:

$14$ paths which have no occurrence of $(xy^2)$,

$15$ paths which contain $(xy^2)$ precisely once and

$2$ paths which contain $(xy^2)$ precisely twice.

Number $P_n$ of nice paths with $(1,2)$-steps:

We derive the number $P_n$ of nice paths which contain $(1,2)$-steps from the generating function $A(t;q)$. Looking again at $[t^4]A(t;q)=2q^2+15q+14$ we see we have to sum up the terms with a factor $q$ evaluated at $q=1$. We can isolate the constant term by evaluating $[t^4]A(t;q)$ at $q=0$.
In order to derive the terms with factor $q$ we calculate the number of nice paths from $(0,0)$ to $(n,n)$ which contain $(1,2)$-steps as
\begin{align*}
P_n=[t^n]\left(A(t;1)-A(t;0)\right)\qquad\qquad n\geq 0\tag{4}
\end{align*}

Number $V_n$ of $(1,2)$-steps in nice paths:

We can also count the number $V_n$ of $(1,2)$-steps in nice paths. In order to get e.g. the $\color{blue}{19}$ $(1,2)$-steps in the paths from $(0,0)$ to $(4,4)$ we differentiate $[t^4]A(t;q)$ w.r.t. $q$ and evaluate at $q=1$:
\begin{align*}
V_4=[t^4]\left(\left.\frac{\partial}{\partial q}A(t;q)\right|_{q=1}\right)=(4q+15)|_{q=1}\color{blue}{=19}
\end{align*}

In general we have
\begin{align*}
V_n&=[t^n]\left(\left.\frac{\partial}{\partial q}A(t;q)\right|_{q=1}\right)\\
&=[t^n]\left.\left(\frac{t}{(1+qt)\sqrt{1-4t(1+qt))}}-\frac{1-\sqrt{1-4t(1+qt)}}{2(1+qt)^2}\right)\right|_{q=1}\tag{5}\\
&=[t^n]\left(t^2+4t^3+(\color {blue}{(4q+15)}t^4+(30q+56)t^5\right.\\
&\qquad\left.\big.+(15q^2+168q+70)t^6+\cdots\big)\right|_{q=1}
\end{align*}

Calculation of $P_n$ and $V_n$:

We manually calculate the polynomial $p_n(q)=[t^n]A(t;q)$ from which we can easily deduce $P_n$ and $V_n$.

We obtain
\begin{align*}
\color{blue}{p_n(q)}&=\color{blue}{[t^n]}\color{blue}{A(t;q)}\\
&=[t^n]\frac{1-\sqrt{1-4t(1+qt)}}{2t(1+qt)}\\
&=[t^n]\left(1-\sum_{j=0}^\infty\binom{\frac{1}{2}}{j}\left(-4t\right)^j\left(1+qt\right)^j\right)\frac{1}{2t(1+qt)}\tag{6}\\
&=2[t^n]\sum_{j=1}^\infty\binom{\frac{1}{2}}{j}\left(-4t\right)^{j-1}\left(1+qt\right)^{j-1}\\
&=2[t^n]\sum_{j=0}^\infty\binom{\frac{1}{2}}{j+1}\left(-4t\right)^{j}\left(1+qt\right)^{j}\\
&=[t^n]\sum_{j=0}^\infty\binom{2j}{j}\frac{1}{j+1}t^j(1+qt)^j\tag{7}\\
&=\sum_{j=0}^n\binom{2j}{j}\frac{1}{j+1}[t^{n-j}](1+qt)^j\tag{8}\\
&\,\,\color{blue}{=\sum_{j=0}^n\binom{2j}{j}\frac{1}{j+1}\binom{j}{n-j}q^{n-j}}\tag{9}
\end{align*}

Comment:

In (6) we use the binomial series expansion.

In (7) we use the binomial identity $\binom{\frac{1}{2}}{j}=\frac{1}{2^{2j-1}}\binom{2j-2}{j-1}\frac{(-1)^{j-1}}{j}$.

In (8) we apply the rule $[t^{p-q}]A(t)=[t^p]t^qA(t)$.

In (9) we select the coefficient of $t^{n-j}$.

We finally conclude from (4), (5) and (9)
\begin{align*}
\color{blue}{P_n}&=p_n(1)-p_n(0)
\color{blue}{=\sum_{j=\left\lceil \frac{n}{2}\right\rceil}^{n-1}\binom{2j}{j}\binom{j}{n-j}\frac{1}{j+1}}\\
\color{blue}{V_n}&=\left.\left(\frac{d}{dq}p_n(q)\right)\right|_{q=1}
\color{blue}{=\sum_{j=\left\lceil \frac{n}{2}\right\rceil}^{n-1}\binom{2j}{j}\binom{j}{n-j}\frac{n-j}{j+1}}
\end{align*}
and get as plausibility check
\begin{align*}
\color{blue}{P_4}&=\sum_{j=2}^3\binom{2j}{j}\binom{j}{4-j}\frac{1}{j+1}=\binom{4}{2}\binom{2}{2}\frac{1}{3}+\binom{6}{3}\binom{3}{1}\frac{1}{4}\\
&=2+15\color{blue}{=17}\\
\color{blue}{V_4}&=\sum_{j=2}^3\binom{2j}{j}\binom{j}{4-j}\frac{4-j}{j+1}=\binom{4}{2}\binom{2}{2}\frac{2}{3}+\binom{6}{3}\binom{3}{1}\frac{1}{4}\\
&=4+15\color{blue}{=19}\\
\end{align*}
in accordance with the calculations above.


问:
Challenging problem: Calculate $\int_0^{2\pi}x^2 \cos(x)\operatorname{Li}_2(\cos(x))dx$
The following problem is proposed by a friend:

$$\int_0^{2\pi}x^2 \cos(x)\operatorname{Li}_2(\cos(x))dx$$

$$=\frac{9}{8}\pi^4-2\pi^3-2\pi^2-8\ln(2)\pi-\frac12\ln^2(2)\pi^2+8\ln(2)\pi G+16\pi\Im\left\{\operatorname{Li}_3\left(\frac{1+i}{2}\right)\right\}$$

My only try is writing

$$\operatorname{Li}_2(\cos(x))=-\int_0^1\frac{\cos(x)\ln(y)}{1-\cos(x)y} \, dy$$

and have no idea how to continue with the double integral. I also tried $\cos(x)=u$, didn't do much.

Any help would be much appreciated.

答:
Part I

This is a long answer, beyond the allowed maximal size = 30K characters.
So i had to split it.

It's because of the question, but also because details for the performed steps are given, hoping that the text should be accesible, up to some complex analysis issues, to a wider circle of readers. The reader in hurry may want to skip long computations, if she or he knows the pattern.
Also computer checks are provided, so that there is (i.e. was for me while typing) an immediate confirmation for the displayed results.

I will use sage for exact computations, and
pari/gp for quick numerical checks. Most of the time for myself, to have an in between check, and further type with confidence.
(Many arguments were done on paper days before, today i would maybe reshape 80 percent, but time... And maybe it is good to see a bloody computation, there is else too much refactored to fit in a few lines.)

I will use $\operatorname{Li}_1$ for the function $x\to-\log(1-x)$, which has the Taylor expansion
$$
\tag{1}
\operatorname{Li}_1(x) :=
\frac x1+\frac {x^2}2+\frac{x^3}3+\dots
$$
around zero, thus motivating the notation.

There is indeed an "idea" of computation, that can be isolated below:

Use the known primitive to integrate expressions like $\frac 1{x-a}\log^2x$ and $\frac1{x-a}\log^3 x$, then use "polarization"
to obtain $AB$ from the squares $A^2, B^2, (A-B)^2$.
(Doing the same with $A^2B$ and/or $AB^2$ to be obtained from the cubes
$A^3, B^3, (A\pm B)^3$, yes, it is possible. But the integrals
corresponding to $(A\pm B)^3$ are not in the same time easy.)

My feeling of progress decided only when to use a substitution or partial integration or something else, so that integrals of these
functions show up. When they show up, we proceed almost algorithmically.

We define the level of complexity of an integral involving polylog factors
like
$\operatorname{Li}_1(s)$ (or $-\log(1-s)$),
$\operatorname{Li}_2(s)$,
$\operatorname{Li}_3(s)$,
$\operatorname{Li}_4(s)$,
and so on,
by adding the "complexities" of the factors, which are $1,2,3,4,$ and so on. Instead of $s$ we may have an other argument, a rational function of
$s$, usually $\pm s$ or $1\pm s$, et caetera.

As orientation, the following ideas to proceed (somehow) were applied.

Dilogarithm identities are used. For instance:
$$
\tag{2}
$$
$$
\begin{aligned}
\operatorname{Li}_2(x) + \operatorname{Li}_2(-x) &= \operatorname{Li}_2(x^2)\ ,\\
\operatorname{Li}_2(x) + \operatorname{Li}_2(1-x) &= -\log(x) \log(1-x)+\frac 16\pi^2\ ,\\
\end{aligned}
$$
(and combinations of them).

Integrals involving trigonometric expressions in $\sin x$, $\cos x$ may be reshaped using the standard substitution $t = \tan\frac x2$. Then we have formally:
$$
\tag{3}
\tan\frac x2 = t\ ,\
x  = 2\arctan t \ ,\
dx =\frac{2\; dt}{1+t^2}\ ,\
\sin x=\frac {2t}{1+t^2}\ ,\
\cos x=\frac{1-t^2}{1+t^2}\ ,
$$
(and so on).

We would like to replace the factor $\operatorname{Li}_2(\cos x)$ of some integral, if possible, with the factor $(\operatorname{Li}_2(\cos x)+\operatorname{Li}_2(-\cos x))$. Then in case of a partial integration w.r.t. "other factors", there is a passage to
$$
\tag{4}
\Big(\ \operatorname{Li}_2(\cos x)+\operatorname{Li}_2(-\cos x)\ \Big)'
=
-\sin x\cdot\Big(\ \operatorname{Li}_1(\cos x)-\operatorname{Li}_2(-\cos x)\ \Big)
\\
=
-\sin x\log\frac{1-\cos x}{1+\cos x}\ ,
$$
and the last expression introduces a "simple $\log$ factor" using the above substitution, since $\frac{1-\cos x}{1+\cos x}
=
\frac{(1+t^2)-(1-t^2)}{(1+t^2)+(1-t^2)}=t^2$.

We try to isolate expressions to be integrated like $\frac 1{x-a}\log(x-b)\log(x-c)$. In case of $b=c$ (and
thus further without restriction $b=c=0$) there is for instance an explicit primitive function:
$$
\tag{5}
G_a(x)
=
\int_0^x\frac{\log^2 t}{t-a}\; dt
=
-\log^2x\cdot\operatorname{Li}_1\left(\frac xa\right)
+2\log x\cdot\operatorname{Li}_2\left(\frac xa\right)
-2\operatorname{Li}_3\left(\frac xa\right)\ .
$$
For different values $b,c$, we may use the "polarization" $BC=\frac 12(B^2+C^2-(B-C)^2)$, with $B=\log(x-b)$, $C=\log(x-c)$.

Note that in the formula for $G_a$, when $x=0$ is plugged in, each $\log x$ is joined with an $O(x)$-function, so the limit is zero. Also, if we plug in $x=1$, then the $\log$-terms are zero, so there is only a contribution from the trilogarithm.

Not used, but it should be recorded here. There is a similar formula for the integral involving $\log^3 t$ (instead of $\log^2t$):
$$
\tag{6}
\int_0^x\frac{\log^3 t}{t-a}\; dt
=
-\log^3x\cdot\operatorname{Li}_1\left(\frac xa\right)
+3\log^2 x\cdot\operatorname{Li}_2\left(\frac xa\right)
+6\log x\cdot\operatorname{Li}_3\left(\frac xa\right)
+6\operatorname{Li}_4\left(\frac xa\right)\ .
$$
To cover products of the shape $B^2C$ with $B,C$ as above, one can use $3(B^2C+BC^2)=(B+C)^3-B^3-C^3$ and $3(B^2C-BC^2)=-(B-C)^3+B^3-C^3$.

The $\arctan$ is also a "kind of logarithm". To make this specific, write
$\frac 1{x^2+1}=\frac 1{2i}\left(\frac1{x-i}-\frac 1{x+i}\right)$, and integrate.
So, formally, $\arctan x=\frac 1{2i}\log \frac {1+it}{1-it}$.
In particular, its "complexity" is also $1$, as the complexity of the $\log$.

Not used, but it should be mentioned here: Parallel to the above relations, we record here:

$$
\tag{7}
$$
$$
\begin{aligned}
\int\frac{\log^2 (x-a)}{1+x^2}\; dx
&=
\log^2(x-a)\cdot(\arctan x-\arctan a)
\\
&\qquad\qquad
+i\log (x-a)\cdot\operatorname{Li}_2\left(\frac {a-x}{a+i}\right)
-i\log (x-a)\cdot\operatorname{Li}_2\left(\frac {a-x}{a-i}\right)
\\
&\qquad\qquad
-i\operatorname{Li}_3\left(\frac {a-x}{a+i}\right)
+i\operatorname{Li}_3\left(\frac {a-x}{a-i}\right)
+C\ ,
\\
\int\frac{\log^3 (x-a)}{1+x^2}\; dx
&=
\log^3(x-a)\cdot(\arctan x-\arctan a)
\\
&\qquad\qquad
+\frac 32i\log^2 (x-a)\cdot\operatorname{Li}_2\left(\frac {a-x}{a+i}\right)
-\frac 32i\log^2 (x-a)\cdot\operatorname{Li}_2\left(\frac {a-x}{a-i}\right)
\\
&\qquad\qquad
-3i\log(x-a)\cdot\operatorname{Li}_3\left(\frac {a-x}{a+i}\right)
+3i\log(x-a)\cdot\operatorname{Li}_3\left(\frac {a-x}{a-i}\right)
\\
&\qquad\qquad
+3i\operatorname{Li}_4\left(\frac {a-x}{a+i}\right)
-3i\operatorname{Li}_4\left(\frac {a-x}{a-i}\right)
+C\ ,
\end{aligned}
$$

It is favorable to compute here formally the integral mentioned above in a relatively general case.
We use the notation $I_A^B(0,b;a)$. The variables $A,B;b;a$ may be complex numbers.
(In case an evaluation for specific values does not make sense, consider the limit for $A,B$ in the expression.
The computation is formal since we do not care which branch of the one or other logarithm is taken. We use one branch,
so that computations make sense. If i am careless, there is a discrete monodromy introduced, also for this reason, there is always a numerical check below.)
$$
\tag{8}
$$
$$
\begin{aligned}
I_A^B(0,b;a)
&:=
\int_A^B\log(t-0)\log(t-b)\cdot\frac 1{t-a}\; dt
\\
&=
\frac 12\int_A^B\Big( \ \log^2 t + \log^2(t-b) - \log^2\frac t{t-b}\ Big)\cdot\frac 1{t-a}\; dt
\ .
\\
&\qquad\text{And now using the primitive function $G_a$ above}
\\
\int_A^B\frac {\log^2 t}{t-a}\; dt
&= [\ G_a(t)\ ]_A^B=G_a(B)-G_a(A)\ ,
\\
\\
\int_A^B\frac {\log^2 (t-b)}{t-a}\; dt
&=
\int_A^B\log^2 u\cdot\frac 1{u-(a-b)}\; du
\\
&=[\ G_{a-b}(t)\ ]_A^B=G_{a-b}(B)-G_{a-b}(A)\ ,
\\
\int_A^B\frac {\log^2 \frac t{t-b}}{t-a}\; dt
&=
\int_{A/(A-b)}^{B/(B-b)}
\log^2 u\frac 1{\frac {ub}{u-1}-a}\cdot\frac{-b}{(u-1)^2}\; du
\\
&=
\int_{A/(A-b)}^{B/(B-b)}
\log^2 u\frac 1{\frac {ub}{u-1}-a}\cdot\frac{-b}{(u-1)^2}\; du
\\
&=
\int_{A/(A-b)}^{B/(B-b)}
\log^2 u\left(\frac 1{u-\frac a{a-b}} - \frac 1{u-1}\right)\; du
\\
&=
[\ G_{a/(a-b)}(t)\ ]_{A/(A-b)}^{B/(B-b)}
-
[\ G_1(t)\ ]_{A/(A-b)}^{B/(B-b)}\ .
\end{aligned}
$$

The given integral can be reshaped as an integral on the one of the intervals $[0,1]$ or $[-1,0]$ or $[0,\infty)$ or... from functions having the complexity at most $3$. Integrals like
$\int_0^1R(t)\log t\; dt$ with a rational function $R$ are considered to be "easy". Its complexity is one. Integrals like
$\int_0^1R(r)\log(1\pm t)\log t\; dt$
or like
$\int_0^1R(r)\arctan t\log t\; dt$
have complexity two, and using $(8)$, they are feasible. It turns out, that such integrals, together with the integral of felt complexity three
$$
K=
\int_0^1\arctan^2 t\cdot \log t\cdot\frac2{1-t^2}\; dt
$$
are enough to solve the issue.

For the integral $K$ displayed above i had to use unusual ideas, so that it is rewritten to have complexity two. This is the only original point
in this answer, else the story is part of the folklore.)

Note that many "pieces" in the final answer are "polylogarithmic periods". For instance $G=\Im\operatorname{Li}_2(i)$. See for instance:

Catalan's constant

In the same link, there is a trilogarithmic expression, mentioned to have a "simple answer":
$$\frac 1{1^3}-\frac 1{3^3}+\frac 1{5^3}-\frac 1{7^3}+\dots
=\Im\operatorname{Li}_3(i)=\frac 1{32}\pi^3\ .$$

We start the computation, and "do something" first.
The substitution $t=\arctan(x/2)$ needs a smaller interval. So
we shift as a first step the integration from $[0,2\pi]$ to the symmetric
interval $[-\pi,\pi]$, breaking it into even and odd pieces, the odd part vanishes, the even part is twice the integral on $[0,\pi]$.

Let $J$ be the value of the integral to be computed. Then:
$$
\tag{9}
$$
$$
\begin{aligned}
J
&=
\int_0^{2\pi}x^2\;\cos x\; \operatorname{Li}_2(\cos x)\;dx
\\
&=
\int_{-\pi}^{\pi}(x+\pi)^2\;\cos(x+\pi)\; \operatorname{Li}_2(\cos (x+\pi))\;dx
\\
&=
-\int_{-\pi}^{\pi}(x^2+\underbrace{2\pi x}_{\text{odd}}+\pi^2)\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
\\
% &=
% -\int_{-\pi}^{\pi}x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
% -\pi^2\int_{-\pi}^{\pi}\cos x\; \operatorname{Li}_2(-\cos x)\;dx
% \\
&=
2
\underbrace{
\int_0^{\pi}-x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
}_{J_1}
+
2\pi^2
\underbrace{
\int_0^{\pi}-\cos x\; \operatorname{Li}_2(-\cos x)\;dx
}_{J_2}
\\
&=2J_1+2\pi^2 J_2\ .
\end{aligned}
$$
Here, after changing $x\to\pi-x$ we have
$$
\tag{10}
J_2
=
\int_0^{\pi}-\cos x\; \operatorname{Li}_2(-\cos x)\;dx
=
\int_0^{\pi}\cos x\; \operatorname{Li}_2(\cos x)\;dx
=\frac 12\pi^2-\pi\ .
$$
Thus $J_1$ gives the complexity.
For $J_2$, explicitly:
$$
\tag{11}
$$
$$
\begin{aligned}
J_2
&=
\int_0^{\pi/2}\cos x\; \operatorname{Li}_2(\cos x)\;dx
+
\int_0^{\pi/2}\cos (\pi-x)\; \operatorname{Li}_2(\cos(\pi-x))\;dx
\\
&=
\Big[\sin x \operatorname{Li}_2(\cos x)\Big]_0^{\pi/2}
-
\int_0^{\pi/2}\sin x\cdot\frac 1{\cos x}
\operatorname{Li}_1(\cos x)\cdot(-\sin x)\; dx
\\
&\qquad
-\Big[\sin x \operatorname{Li}_2(-\cos x)\Big]_0^{\pi/2}
+\int_0^{\pi/2}\sin x\cdot\frac 1{-\cos x}
\operatorname{Li}_1(-\cos x)\cdot(-\sin x)\; dx
\\
&=\int_0^{\pi/2}\frac {\sin^2 x}{\cos x}
\log\frac{1+\cos x}{1-\cos x}\; dx
\\
&\qquad\text{and with $t=\tan\frac x2$, $x=2\arctan t$, $dx=\frac2{1+t^2}\; dt$,
$\sin x=\frac {2t}{1+t^2}$, $\cos x=\frac{1-t^2}{1+t^2}$}
\\
&=
\int_0^1\frac{4t^2}{(1+t^2)^2}\cdot\frac{1+t^2}{1-t^2}
\cdot\log\left(\frac{(1+t^2)+(1-t^2)}{(1+t^2)-(1-t^2)}\right)
\cdot\frac 2{1+t^2}\; dt
\\
&=
-\int_0^1\frac{8t^2}{(1+t^2)^2(1-t^2)}\cdot\log t^2\; dt
\\
&=
2\int_0^1\left(\frac {2t}{1+t^2}+\log(1-t) - \log(1+t)\right)'
\log t\; dt
\\
&=
-2\int_0^1
\left(\frac {2t}{1+t^2}+\log(1-t) - \log(1+t)\right)\;\frac 1 t
\; dt
\\
&=-4\arctan\Big|_0^1 +2\Big[\operatorname{Li}_2(t) - \operatorname{Li}_2(-t)\Big]_0^1
\\
&=-\pi +\frac 12\pi^2\ .
\end{aligned}
$$
Here,
$\operatorname{Li}_2(1)=\zeta(2)=\frac 16\pi^2$.

And
$\operatorname{Li}_2(-1)=-\operatorname{Li}_2(1)+\frac 12\operatorname{Li}_2(1^2)=
-\frac 1{12}\pi^2$.

Computer check for the value of $J_2$. I will use pari/gp for this.
There are some issues near $0$ and $\pi$, so i will integrate numerically on some interval $[\epsilon, \pi-\epsilon]$.

```<code>? \p 50
   realprecision = 57 significant digits (50 digits displayed)
? eps = 0.000008;
? J2approx = intnum( x=eps, Pi-eps, cos(x)*dilog(cos(x)) )
%133 = 1.7931898077460863662640447913454517588781602204055
? Pi^2/2 - Pi
%134 = 1.7932095469548860709546021166585726834596803042453
? J2rewritten = intnum( x=0, Pi/2, sin(x)^2/cos(x) * log( (1+cos(x))/(1-cos(x)) ) )
%135 = 1.7932095469548860709546021166585726834596803042453
? J2rewritten2 = -intnum( t=0, 1, 16*t^2/(1+t^2)^2/(1-t^2) * log(t) )
%136 = 1.7932095469548860709546021166585726834596803042453
</code>```

So the value $\frac 12\pi^2-\pi$ is numerically validated, it is the only way to check using pari/gp.

Using sage, we can "compute" / request an exact value:

```<code>sage: var('t');
sage: integral( -16*t^2 / (1+t^2)^2 / (1-t^2) * log(t), t, 0, 1 )
-pi + 1/2*pi^2
sage: integral( sin(x)^2/cos(x) * log( (1+cos(x))/(1-cos(x)) ), x, 0, pi/2 )
-pi + 1/2*pi^2
</code>```

(Although for the initial form of the integral there are some maxima questions.)

So the integral $J_1$ is the issue.
I will use for the dilog term the identity
$
\operatorname{Li}_2(s)+
\operatorname{Li}_2(-s)=
\frac 12\operatorname{Li}_2(s^2)
$, thus obtaining in part a similar grouping of $\operatorname{Li}_2(\cos x)-\operatorname{Li}_2(-\cos x)$, which is favorable.
$$
\tag{12}
$$
$$
\begin{aligned}
J_1
&=
\int_0^{\pi}-x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
\\
&=
\frac 12
\int_0^{\pi}-x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
+
\frac 12
\int_0^{\pi}-x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
\\
% &=
% \frac 12
% \int_0^{\pi}x^2\;\cos x\; \operatorname{Li}_2(\cos x)\;dx
% +
% \frac 12
% \int_0^{\pi}-x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
% \\
% &\qquad\qquad
% -\frac 14
% \int_0^{\pi}x^2\;\cos x\; \operatorname{Li}_2(\cos^2 x)\;dx
% \\
&=
\frac 12
\underbrace{
\int_0^{\pi}x^2\;\cos x\; \Big(
  \operatorname{Li}_2(\cos x)
- \operatorname{Li}_2(-\cos x)
\Big)
\;dx}_{J_{11}}
\\
&\qquad\qquad
-\frac 14
\underbrace{
\int_0^{\pi}x^2\;\cos x\; \operatorname{Li}_2(\cos^2 x)\;dx
}_{J_{12}}
\\
&=\frac 12 J_{11}-\frac 14 J_{12}\ .
\end{aligned}
$$
Here is a numerical check for the above equality.

```<code>eps = 0.000008;
J1  = intnum( x=eps, Pi-eps, -x^2 * cos(x) * dilog(-cos(x)) );
J11 = intnum( x=eps, Pi-eps,  x^2 * cos(x) * ( dilog(cos(x)) - dilog(-cos(x)) ) );
J12 = intnum( x=eps, Pi-eps, -x^2 * cos(x) * dilog( cos(x)^2 ) );
</code>```

And with the above variables, the difference is in the range of the used precision...

```<code>? J1 - J11/2 - J12/4
%197 = 3.186183822264904554 E-58
</code>```

Let us compute the "simpler" integral from above, $J_{12}$, first. We have:
$$
\tag{13}
$$
$$
\begin{aligned}
J_{12}
&=
\int_0^\pi x^2\;\cos x\; \operatorname{Li}_2(\cos^2 x)\;dx
\\
&=
\int_0^\pi (\ 2x\cos x + (x^2-2)\sin x\ )'\; \operatorname{Li}_2(\cos^2 x)\;dx
\\
&=2\pi\cos \pi\operatorname{Li}_2(1)
-
\int_0^\pi (\ 2x\cos x + (x^2-2)\sin x\ )\; \frac 1{\cos^2 x}\operatorname{Li}_1(\cos^2 x)\cdot (\cos^2 x)'\;dx
\\
&=-\frac 13\pi^3
-
2\int_0^\pi (\ 2x\cos x + (x^2-2)\sin x\ )\; \frac {\sin x}{\cos x}\log(\sin^2 x)\;dx
\\
&=
-\frac 13\pi^3
-
8\underbrace{\int_0^\pi x\sin x\log \sin x\;dx}_{\pi(\log 2-1)}
\\
&\qquad\qquad
-
4\int_0^\pi x^2\frac {\sin^2 x}{\cos x}\log \sin x\;dx
+
8\underbrace{
\int_0^\pi \frac {\sin^2 x}{\cos x}\log\sin x\;dx
}_{0\text{ via }x\to\pi-x}
\\
&=
-\frac 13\pi^3
-8\pi\log 2+8\pi
-2\int_0^\pi (x^2-(\pi-x)^2)\frac {\sin^2 x}{\cos x}\log \sin x\;dx
\\
&=
-\frac 13\pi^3
-8\pi\log 2+8\pi
-4\pi\underbrace{\int_0^\pi x\frac {\sin^2 x}{\cos x}\log \sin x\;dx}_{J_{121}}
\\
&=
-\frac 13\pi^3
-8\pi\log 2+8\pi
-
4\pi J_{121}\ ,\text{ where}
\\[2mm]
%
J_{121}
&:=\int_0^\pi x\;\frac {\sin^2 x}{\cos x}\;\log \sin x\;dx
\\
&=-\int_{-\pi/2}^{\pi/2} \left(x+\frac\pi 2\right)\;\frac {\cos^2 x}{\sin^2 x}\;\log \cos x\;\cdot\;\sin x\;dx
\\
&=-\int_{-\pi/2}^{\pi/2} x\;\frac {\cos^2 x}{\sin^2 x}\;\log \cos x\;\cdot\;\sin x\;dx
\\
&=2\int_0^{\pi/2} x\;\frac {\cos^2 x}{\sin^2 x}\;\log \cos x\;\cdot\;d(\cos x)
\\
&=
2\int_1^0 \arccos t\frac{t^2}{1-t^2}\log t\; dt
\\
&=
\int_0^1 2\arccos t\;\frac {(1-t^2)-1}{1-t^2}\;\log t\;dt
\\
&=
\underbrace{\int_0^1 2\arccos t\log t\;dt}_{2\log 2-4}
-
\int_0^1 \arccos t\left(\frac 1{1-t}+\frac 1{1+t}\right)\log t\;dt
\\
&= 2\log2-4
-
\int_0^1 \arccos t\;
(\operatorname{Li}_2(1-t))'\; dt
\\
&\qquad\qquad
+
\int_0^1 \arccos t\;
(\operatorname{Li}_2(1+t))'\; dt
-
\log(-1)
\int_0^1 \arccos t\cdot \frac 1{1+t}\; dt
\\
&=2\log2-4
-\arccos 0\cdot\operatorname{Li}_2(1)
\\
&\qquad\qquad
-
\int_0^1 \frac{\operatorname{Li}_2(1-t)}{\sqrt{1-t^2}}\; dt
+\arccos 0\cdot\operatorname{Li}_2(1)
+
\Re\int_0^1 \frac{\operatorname{Li}_2(1+t)}{\sqrt{1-t^2}}\; dt
\\
&=2\log2-4
-
\int_0^{\pi/2} \frac{\operatorname{Li}_2(1-\cos u)}{\sin u}\; \sin u\;du
+
\Re\int_0^{\pi/2} \frac{\operatorname{Li}_2(1+\cos u)}{\sin u}\; \sin u\; du
\\
&=
2\log2-4
-
\int_0^{\pi/2} \operatorname{Li}_2(1-\cos u)\; du
+
\Re\int_0^{\pi/2} \operatorname{Li}_2(1+\cos u)\; du
\\
&\qquad\text{ and with }
\operatorname{Li}_2(1-c) = -\operatorname{Li}_2(c) + \frac 16\pi^2 -\log(c)\log(1-c)\ ,\\
\\
&\qquad\text{ and with }
\operatorname{Li}_2(1+c) = -\operatorname{Li}_2(-c) + \frac 16\pi^2 -\log(-c)\log(1+c)\ ,\\
\\
&=
2\log2-4
+
\underbrace{
\int_0^{\pi/2} \operatorname{Li}_2(\cos u)\; du
-
\int_0^{\pi/2} \operatorname{Li}_2(-\cos u)\; du
}_{J_{1211}}
\\
&\qquad\qquad
+
\underbrace
{\int_0^{\pi/2} \log\cos u\cdot\log\frac {1-\cos u}{1+\cos u}\; du
}_{J_{1212}}
\ .
\end{aligned}
$$
Well, $J_{1212}$ can be computed "algorithmically", so we eliminate this from the task list first.
Recall, we have a formula to integrate expressions like $\frac 1{x-a}\log^2 x$. Using "polarization",
products $AB$ of different logarithms $A=\log(x-a)$ and $B=\log(x-b)$, can be reshaped to products of the "same" log, use
$AB=\frac 12(A^2+B^2-(A-B)^2)$. This gives:
$$
\begin{aligned}
J_{1212}
&=\int_0^{\pi/2} \log\cos u\cdot\log\frac {1-\cos u}{1+\cos u}\; du\\
&=\int_0^1 \log\frac{1-t^2}{1+t^2}\cdot\log\frac {(1+t^2)-(1-t^2)}{(1+t^2)+(1-t^2)}\; \frac 2{1+t^2}\; dt\\
&=
4\int_0^1 \frac{\log(1-t)\cdot\log t}{1+t^2}\; dt
+4\int_0^1 \frac{\log(1+t)\cdot\log t}{1+t^2}\; dt
-4\int_0^1 \frac{\log(1+t^2)\cdot\log t}{1+t^2}\; dt
\\
&=
4\left(
-\frac 1{128}\pi^3-\frac 1{32}\pi\log^2 2+\Im\operatorname{Li}_3\left(\frac {1+i}2\right)
\right)
+
4
\left(
+\frac {11}{128}\pi^3+\frac 3{32}\pi\log^2 2-2G\log 2-3\Im\operatorname{Li}_3\left(\frac {1+i}2\right)
\right)
\\
&\qquad\qquad
-
4\left(
-\frac {2}{128}\pi^3-\frac 2{32}\pi\log^2 2-G\log 2+2\Im\operatorname{Li}_3\left(\frac {1+i}2\right)
\right)
\\
&=
\frac 38\pi^3
+\frac 12\pi\log^2 2
-4G\log2
-16\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ .
\end{aligned}
$$
Numerical check:

```<code>i = I; pi = Pi; G = imag(dilog(i));
J1212 = intnum( u=0, pi/2, log(cos(u)) * log( (1-cos(u)) / (1+cos(u)) ) );
J1212_claimed = 3/8 * pi^3 + 1/2*pi*log(2)^2 - 4*G*log(2) - 16*imag(polylog(3, (1+i)/2 ));

? J1212
%187 = 0.72121319477695937923367893878228892950489772911404
? J1212_claimed
%188 = 0.72121319477695937923367893878228892950489772911404

</code>```

To see that we have played a "purely linear game" with (5), here are some computational details.
We tacitly use $\frac 1{t^2+1}=\frac 1{2i}    \left(\frac1{t-i}-\frac 1{t+i}\right)$.
$$
\begin{aligned}
\int_0^1 \frac{\log^2 t}{1+t^2}\; dt
&=
\frac 1{2i}\left(
\int_0^1 \frac{\log^2 t}{t-i}\; dt
-
\int_0^1 \frac{\log^2 t}{t+i}\; dt
\right)
\\
&=\frac 1{2i}\Big[\ G_i(t)-G_{-i}(t)\ \Big]_0^1
\\
&=\frac 1{2i}\Big[\ G_i(1)-G_{-i}(1)\ \Big]
\\
&=\frac 1{2i}\left[\
-2\operatorname{Li}_3\left(\frac 1i\right)
+2\operatorname{Li}_3\left(\frac 1{-i}\right)
\ \right]
\\
&=2\Im  \operatorname{Li}_3(i)
\\
&=2\cdot \frac 1{32}\pi^3=\frac 1{16}\pi^3\ .
\end{aligned}
$$
Also:
$$
\begin{aligned}
\int_0^1 \frac{\log^2 (1-t)}{1+t^2}\; dt
&=
\frac 1{2i}\left(
\int_0^1 \frac{\log^2 t}{1-t-i}\; dt
-
\int_0^1 \frac{\log^2 t}{1-t+i}\; dt
\right)
\\
&=
\frac 1{2i}\left(
-
\int_0^1 \frac{\log^2 t}{t-(1-i)}\; dt
+
\int_0^1 \frac{\log^2 t}{t-(1+i)}\; dt
\right)
\\
&=\frac 1{2i}\Big[\ G_{1+i}(t)-G_{1-i}(t)\ \Big]_0^1
\\
&=\frac 1{2i}\Big[\ G_{1+i}(1)-G_{1-i}(1)\ \Big]\ ,
\\
&=\frac 1{2i}\left[\
-2\operatorname{Li}_3\left(\frac 1{1+i}\right)
+2\operatorname{Li}_3\left(\frac 1{1-i}\right)
\ \right]
\\
&=2\Im  \operatorname{Li}_3\left(\frac {1+i}2\right)
\ .
\end{aligned}
$$
And finally, with the substitution $u=t/(1-t)$:
$$
\begin{aligned}
&\!\!\!\int_0^1 \frac{\log^2 (t/(1-t))}{1+t^2}\; dt
\\
&=
\int_0^\infty \frac{\log^2 u}{1+\frac{u^2}{(1+u)^2}}\; \frac 1{(1+u)^2}\;du
\\
&=
\int_0^1 \frac{\log^2 u} {(1+u)^2+u^2}\;du
+
\int_1^\infty \frac{\log^2 u} {(1+u)^2+u^2}\;du
\\
&=
\int_0^1 \frac{\log^2 u} {(1+u)^2+u^2}\;du
+
\int_0^1 \frac{\log^2 u} {(u+1)^2+1^2}\;du
\\
&=
\int_0^1 \log^2 u\frac 1{2i}\left( \frac 1{u-\frac12(-1+i)} - \frac 1{u-\frac12(-1-i)} \right)\;du
\\
&\qquad\qquad
+
\int_0^1 \log^2 u\frac 1{2i}\left( \frac 1{u-(-1+i)} - \frac 1{u-(-1-i)} \right)\;du
\\
&=
\frac 1{2i}\Big[\ G_{(-1+i)/2}(t) -  G_{(-1-i)/2}(t)\ \Big]_0^1
+
\frac 1{2i}\Big[\ G_{-1+i}(t) -  G_{-1-i}(t)\ \Big]_0^1
\\
&=
\frac 1{2i}\left(
\
2\operatorname{Li}_3\left(\frac 2{-1-i}\right)
-
2\operatorname{Li}_3\left(\frac 2{-1+i}\right)
+
2\operatorname{Li}_3\left(\frac 1{-1-i}\right)
-
2\operatorname{Li}_3\left(\frac 1{-1+i}\right)
\ \right)
\\
&=
2\Im\operatorname{Li}_3\left(-1+i\right)
+
2\Im\operatorname{Li}_3\left(\frac {-1+i}2\right)
\qquad(z=1-i)
\\
&=
2\Im\Big(\
\operatorname{Li}_3(-z) -
\operatorname{Li}_3(-z^{-1})\ \Big)
=
2\Im\left(-\frac16\log^3 z-\frac 16\pi^2\log z\right)=\dots
\ .
\end{aligned}
$$
(So $\log 2$ and $\pi$ show up soon.)
Here is a quick numerical test for the above. (So that i can further type.)

```<code>? intnum( t=0, 1, log(t)^2 / (1+t^2) )
%231 = 1.9378922925187387609672696916938372001390805353678
? Pi^3/16
%232 = 1.9378922925187387609672696916938372001390805353678
? intnum( t=0, 1, log(1-t)^2 / (1+t^2) )
%233 = 1.1401548141775379563912195151801491021262916198375
? 2*imag( polylog(3, (1+i)/2) )
%234 = 1.1401548141775379563912195151801491021262916198375
? intnum( t=0, 1, log( t/(1-t) )^2 / (1+t^2) )
%235 = 2.5167020943309544685663530996649317514086075354493
? 2*imag( polylog(3, -1+i) + polylog(3, (-1+i)/2) )
%236 = 2.5167020943309544685663530996649317514086075354493
? z=1-I; 2*imag( -1/6*log(z)*(log(z)^2+pi^2) )
%237 = 2.5167020943309544685663530996649317514086075354493
</code>```

In the following related post, pisco also computed these integrals using different methods.
Please compare to have an alternative view.

Computation of integrals, math stackexchange question 3854736

This was $J_{1212}$.
The remained integral  $J_{1211}$ is not so simple.
$$
\tag{14}
$$
$$
\begin{aligned}
J_{1211}
&=
\int_0^{\pi/2} u'\operatorname{Li}_2(\cos u)\; du
-
\int_0^{\pi/2} u'\operatorname{Li}_2(-\cos u)\; du
\\
&=
-
\int_0^{\pi/2} u\cdot
\frac{\sin u}{\cos u}\cdot\log\frac{1-\cos u}{1+\cos u}\; du
\\
&=
-\int_0^1 2\arctan t
\;\frac{2t}{1-t^2}\; \log t^2\;\frac 2{1+t^2}\; dt
\\
&=
-4
\int_0^1 \left(
\frac 1{1-t} - \frac 1{1+t} +\frac{2t}{1+t^2}
\right)\cdot
\arctan t\cdot
\log t\; dt
\\
&=-4(J_{1211a} - J_{1211b} + J_{1211c})\ .
\end{aligned}
$$
Here, $J_{1211a}$, $J_{1211b}$, $J_{1211c}$ are the correspondingly integrals obtained by dissolving the parentheses.

One can show using either $(8)$, or the linked related computations, the formulas for the integrals indexed $1211a$, $1211b$, $1211c$:
$$
\tag{15}
$$
$$
\begin{aligned}
J_{1211a} &= \frac 1{16}\left[\ -\pi^3-\pi\log^2 2+ 8G\log2 + 32\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ \right]\ ,\\
J_{1211b} &= \frac 1{64}\Big[\ -\pi^3 + 32G\log2\ \Big]\ ,\\
J_{1211c} &= \frac 1{16}\left[\ \pi^3+2\pi\log^2 2 -64\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ \right]\ ,
\\[3mm]
J_{1211} &= \frac 1{16}\left[\ -\pi^3-4\pi\log^2 2 +128\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ \right]\ ,
\\
J_{1212} &= \frac 1{16}\left[\ 6\pi^3+8\pi\log^2 2  -64G\log 2 - 256\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ \right]\ ,
\\
J_{121} &= 2\log 2-4 + J_{1211} +J_{1212}\\
&=
\frac 1{16}\left[\ 5\pi^3+4\pi\log^2 2  -64G\log 2 - 128\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ \right]
+2\log 2-4
\ .
\end{aligned}
$$
Numerical checks:

```<code>eps = 0.8e-5; pi = Pi; i = I;
G = imag( dilog(i) );
# J1211 = intnum( u=eps, pi/2, dilog(cos(u)) ) - intnum( u=eps, pi/2, dilog(-cos(u)) );
J1211  = intnum( t=0, 1, 4 * ( 1/(1-t) - 1/(1+t) +2*t/(1+t^2) ) * atan(t) * log(t) )
J1211a = intnum( t=0, 1, atan(t) * log(t) / (1-t) );
J1211b = intnum( t=0, 1, atan(t) * log(t) / (1+t) );
J1211c = intnum( t=0, 1, atan(t) * log(t) * 2*t / (1+t^2) );

J1211a - (-pi^3 -   pi*log(2)^2 +  8*G*log(2) + 32*imag(polylog(3, (1+i)/2))) / 16
J1211b - (-pi^3                 + 32*G*log(2)                               ) / 64
J1211c - (+pi^3 + 2*pi*log(2)^2               - 64*imag(polylog(3, (1+i)/2))) / 16

J1211
4*J1211a - 4*J1211b + 4*J1211c
</code>```

Yes, the differences in the second block are covered by the precision used,
and we have a final answer for $J_{1211}$.

To have an example of calculation:
$$
\begin{aligned}
J_{1211b} &=
\frac 1{2i}
\int_0^1
\log t\cdot\log\frac {1+it}{1-it}\cdot\frac 1{t+1}\; dt\ ,
\\
\int_0^1
\frac {\log^2 t}{t+1}\; dt
&=
[\ G_{-1}(t)\ ]_0^1=-2\operatorname{Li}_3(-1)=\frac 32\zeta(3)
\ ,\text{ (but not needed)}
\\
\int_0^1
\frac {\log^2 (1+it)}{t+1}\; dt
&=
\int_1^{1+i}
\log^2 u\;\cdot\frac 1{(u-1)+i}\; du
\\
&=
[ \ G_{1-i}(t)\ ]_1^{1+i} =G_{1-i}(1+i)-G_{1-i}(1)
\\
&=
-\log(1+i)^2\cdot\operatorname{Li}_1(i)
+2\log(1+i)\cdot\operatorname{Li}_2(i)
\ ,
\\
\int_0^1
\frac {\log^2 (1-it)}{t+1}\; dt
&=\text{the complex conjugate of the above}\ ,
\\
\int_0^1
\frac {\log^2 \frac t{1+it}}{t+1}\; dt
&=
-
\int_0^{1/(1+i)}
\log^2 u\;\cdot\frac 1{\frac {iu}{u+i}+1}\; \frac 1{(u+i)^2}\; du
%
% u = t/(1+it), u + uit = t, t = u/(1-ui) = ui/(u+i)
\\
&=
\int_0^{1/(1+i)}
\log^2 u\;\cdot\left(\frac 1{u+\frac 12(1+i)} - \frac 1{u+i}\right)
\\
&=[\ G_{-(1+i)/2}(u)-G_{-i}(u)\ ]_0^{1/(1+i)} =
G_{-(1+i)/2}\left(\frac{1-i}2\right)-G_{-i}\left(\frac{1-i}2\right)
\\
&=
-\log^2\frac{1-i}2\cdot \operatorname{Li}_1(i)
+2\log\frac{1-i}2\cdot \operatorname{Li}_2(i)
-2\operatorname{Li}_3(i)
\\
&\qquad\qquad
-\log^3\frac{1-i}2
- 2\log\frac{1-i}2 \cdot\operatorname{Li}_2\left(\frac{1+i}2\right)
+ 2\operatorname{Li}_3\left(\frac{1+i}2\right)
\ .
\\
\int_0^1
\frac{\log^2 \frac t{1-it}}{t+1}\; dt
&=\text{the complex conjugate of the above value.}
\\
J_{1211b} &=
\frac 1{2i}
\int_0^1
\log t\;\log\frac {1+it}{1-it}\cdot\frac 1{t+1}\; dt
\\
&=
\frac 1{4i}
\int_0^1
\Bigg(\log^2(1+it)-\log^2(1-it)
\\
&\qquad\qquad\qquad\qquad
-\log^2\frac t{1+it} +\log^2\frac t{1-it}\Bigg)\cdot\frac 1{t+1}\; dt
\ ,
\end{aligned}
$$
and the computation leads to the claimed result.

to be continued...

(Please look around for the second part of the answer.)

Body:
Part I

This is a long answer, beyond the allowed maximal size = 30K characters.
So i had to split it.

It's because of the question, but also because details for the performed steps are given, hoping that the text should be accesible, up to some complex analysis issues, to a wider circle of readers. The reader in hurry may want to skip long computations, if she or he knows the pattern.
Also computer checks are provided, so that there is (i.e. was for me while typing) an immediate confirmation for the displayed results.

I will use sage for exact computations, and
pari/gp for quick numerical checks. Most of the time for myself, to have an in between check, and further type with confidence.
(Many arguments were done on paper days before, today i would maybe reshape 80 percent, but time... And maybe it is good to see a bloody computation, there is else too much refactored to fit in a few lines.)

I will use $\operatorname{Li}_1$ for the function $x\to-\log(1-x)$, which has the Taylor expansion
$$
\tag{1}
\operatorname{Li}_1(x) :=
\frac x1+\frac {x^2}2+\frac{x^3}3+\dots
$$
around zero, thus motivating the notation.

There is indeed an "idea" of computation, that can be isolated below:

Use the known primitive to integrate expressions like $\frac 1{x-a}\log^2x$ and $\frac1{x-a}\log^3 x$, then use "polarization"
to obtain $AB$ from the squares $A^2, B^2, (A-B)^2$.
(Doing the same with $A^2B$ and/or $AB^2$ to be obtained from the cubes
$A^3, B^3, (A\pm B)^3$, yes, it is possible. But the integrals
corresponding to $(A\pm B)^3$ are not in the same time easy.)

My feeling of progress decided only when to use a substitution or partial integration or something else, so that integrals of these
functions show up. When they show up, we proceed almost algorithmically.

We define the level of complexity of an integral involving polylog factors
like
$\operatorname{Li}_1(s)$ (or $-\log(1-s)$),
$\operatorname{Li}_2(s)$,
$\operatorname{Li}_3(s)$,
$\operatorname{Li}_4(s)$,
and so on,
by adding the "complexities" of the factors, which are $1,2,3,4,$ and so on. Instead of $s$ we may have an other argument, a rational function of
$s$, usually $\pm s$ or $1\pm s$, et caetera.

As orientation, the following ideas to proceed (somehow) were applied.

Dilogarithm identities are used. For instance:
$$
\tag{2}
$$
$$
\begin{aligned}
\operatorname{Li}_2(x) + \operatorname{Li}_2(-x) &= \operatorname{Li}_2(x^2)\ ,\\
\operatorname{Li}_2(x) + \operatorname{Li}_2(1-x) &= -\log(x) \log(1-x)+\frac 16\pi^2\ ,\\
\end{aligned}
$$
(and combinations of them).

Integrals involving trigonometric expressions in $\sin x$, $\cos x$ may be reshaped using the standard substitution $t = \tan\frac x2$. Then we have formally:
$$
\tag{3}
\tan\frac x2 = t\ ,\
x  = 2\arctan t \ ,\
dx =\frac{2\; dt}{1+t^2}\ ,\
\sin x=\frac {2t}{1+t^2}\ ,\
\cos x=\frac{1-t^2}{1+t^2}\ ,
$$
(and so on).

We would like to replace the factor $\operatorname{Li}_2(\cos x)$ of some integral, if possible, with the factor $(\operatorname{Li}_2(\cos x)+\operatorname{Li}_2(-\cos x))$. Then in case of a partial integration w.r.t. "other factors", there is a passage to
$$
\tag{4}
\Big(\ \operatorname{Li}_2(\cos x)+\operatorname{Li}_2(-\cos x)\ \Big)'
=
-\sin x\cdot\Big(\ \operatorname{Li}_1(\cos x)-\operatorname{Li}_2(-\cos x)\ \Big)
\\
=
-\sin x\log\frac{1-\cos x}{1+\cos x}\ ,
$$
and the last expression introduces a "simple $\log$ factor" using the above substitution, since $\frac{1-\cos x}{1+\cos x}
=
\frac{(1+t^2)-(1-t^2)}{(1+t^2)+(1-t^2)}=t^2$.

We try to isolate expressions to be integrated like $\frac 1{x-a}\log(x-b)\log(x-c)$. In case of $b=c$ (and
thus further without restriction $b=c=0$) there is for instance an explicit primitive function:
$$
\tag{5}
G_a(x)
=
\int_0^x\frac{\log^2 t}{t-a}\; dt
=
-\log^2x\cdot\operatorname{Li}_1\left(\frac xa\right)
+2\log x\cdot\operatorname{Li}_2\left(\frac xa\right)
-2\operatorname{Li}_3\left(\frac xa\right)\ .
$$
For different values $b,c$, we may use the "polarization" $BC=\frac 12(B^2+C^2-(B-C)^2)$, with $B=\log(x-b)$, $C=\log(x-c)$.

Note that in the formula for $G_a$, when $x=0$ is plugged in, each $\log x$ is joined with an $O(x)$-function, so the limit is zero. Also, if we plug in $x=1$, then the $\log$-terms are zero, so there is only a contribution from the trilogarithm.

Not used, but it should be recorded here. There is a similar formula for the integral involving $\log^3 t$ (instead of $\log^2t$):
$$
\tag{6}
\int_0^x\frac{\log^3 t}{t-a}\; dt
=
-\log^3x\cdot\operatorname{Li}_1\left(\frac xa\right)
+3\log^2 x\cdot\operatorname{Li}_2\left(\frac xa\right)
+6\log x\cdot\operatorname{Li}_3\left(\frac xa\right)
+6\operatorname{Li}_4\left(\frac xa\right)\ .
$$
To cover products of the shape $B^2C$ with $B,C$ as above, one can use $3(B^2C+BC^2)=(B+C)^3-B^3-C^3$ and $3(B^2C-BC^2)=-(B-C)^3+B^3-C^3$.

The $\arctan$ is also a "kind of logarithm". To make this specific, write
$\frac 1{x^2+1}=\frac 1{2i}\left(\frac1{x-i}-\frac 1{x+i}\right)$, and integrate.
So, formally, $\arctan x=\frac 1{2i}\log \frac {1+it}{1-it}$.
In particular, its "complexity" is also $1$, as the complexity of the $\log$.

Not used, but it should be mentioned here: Parallel to the above relations, we record here:

$$
\tag{7}
$$
$$
\begin{aligned}
\int\frac{\log^2 (x-a)}{1+x^2}\; dx
&=
\log^2(x-a)\cdot(\arctan x-\arctan a)
\\
&\qquad\qquad
+i\log (x-a)\cdot\operatorname{Li}_2\left(\frac {a-x}{a+i}\right)
-i\log (x-a)\cdot\operatorname{Li}_2\left(\frac {a-x}{a-i}\right)
\\
&\qquad\qquad
-i\operatorname{Li}_3\left(\frac {a-x}{a+i}\right)
+i\operatorname{Li}_3\left(\frac {a-x}{a-i}\right)
+C\ ,
\\
\int\frac{\log^3 (x-a)}{1+x^2}\; dx
&=
\log^3(x-a)\cdot(\arctan x-\arctan a)
\\
&\qquad\qquad
+\frac 32i\log^2 (x-a)\cdot\operatorname{Li}_2\left(\frac {a-x}{a+i}\right)
-\frac 32i\log^2 (x-a)\cdot\operatorname{Li}_2\left(\frac {a-x}{a-i}\right)
\\
&\qquad\qquad
-3i\log(x-a)\cdot\operatorname{Li}_3\left(\frac {a-x}{a+i}\right)
+3i\log(x-a)\cdot\operatorname{Li}_3\left(\frac {a-x}{a-i}\right)
\\
&\qquad\qquad
+3i\operatorname{Li}_4\left(\frac {a-x}{a+i}\right)
-3i\operatorname{Li}_4\left(\frac {a-x}{a-i}\right)
+C\ ,
\end{aligned}
$$

It is favorable to compute here formally the integral mentioned above in a relatively general case.
We use the notation $I_A^B(0,b;a)$. The variables $A,B;b;a$ may be complex numbers.
(In case an evaluation for specific values does not make sense, consider the limit for $A,B$ in the expression.
The computation is formal since we do not care which branch of the one or other logarithm is taken. We use one branch,
so that computations make sense. If i am careless, there is a discrete monodromy introduced, also for this reason, there is always a numerical check below.)
$$
\tag{8}
$$
$$
\begin{aligned}
I_A^B(0,b;a)
&:=
\int_A^B\log(t-0)\log(t-b)\cdot\frac 1{t-a}\; dt
\\
&=
\frac 12\int_A^B\Big( \ \log^2 t + \log^2(t-b) - \log^2\frac t{t-b}\ Big)\cdot\frac 1{t-a}\; dt
\ .
\\
&\qquad\text{And now using the primitive function $G_a$ above}
\\
\int_A^B\frac {\log^2 t}{t-a}\; dt
&= [\ G_a(t)\ ]_A^B=G_a(B)-G_a(A)\ ,
\\
\\
\int_A^B\frac {\log^2 (t-b)}{t-a}\; dt
&=
\int_A^B\log^2 u\cdot\frac 1{u-(a-b)}\; du
\\
&=[\ G_{a-b}(t)\ ]_A^B=G_{a-b}(B)-G_{a-b}(A)\ ,
\\
\int_A^B\frac {\log^2 \frac t{t-b}}{t-a}\; dt
&=
\int_{A/(A-b)}^{B/(B-b)}
\log^2 u\frac 1{\frac {ub}{u-1}-a}\cdot\frac{-b}{(u-1)^2}\; du
\\
&=
\int_{A/(A-b)}^{B/(B-b)}
\log^2 u\frac 1{\frac {ub}{u-1}-a}\cdot\frac{-b}{(u-1)^2}\; du
\\
&=
\int_{A/(A-b)}^{B/(B-b)}
\log^2 u\left(\frac 1{u-\frac a{a-b}} - \frac 1{u-1}\right)\; du
\\
&=
[\ G_{a/(a-b)}(t)\ ]_{A/(A-b)}^{B/(B-b)}
-
[\ G_1(t)\ ]_{A/(A-b)}^{B/(B-b)}\ .
\end{aligned}
$$

The given integral can be reshaped as an integral on the one of the intervals $[0,1]$ or $[-1,0]$ or $[0,\infty)$ or... from functions having the complexity at most $3$. Integrals like
$\int_0^1R(t)\log t\; dt$ with a rational function $R$ are considered to be "easy". Its complexity is one. Integrals like
$\int_0^1R(r)\log(1\pm t)\log t\; dt$
or like
$\int_0^1R(r)\arctan t\log t\; dt$
have complexity two, and using $(8)$, they are feasible. It turns out, that such integrals, together with the integral of felt complexity three
$$
K=
\int_0^1\arctan^2 t\cdot \log t\cdot\frac2{1-t^2}\; dt
$$
are enough to solve the issue.

For the integral $K$ displayed above i had to use unusual ideas, so that it is rewritten to have complexity two. This is the only original point
in this answer, else the story is part of the folklore.)

Note that many "pieces" in the final answer are "polylogarithmic periods". For instance $G=\Im\operatorname{Li}_2(i)$. See for instance:

Catalan's constant

In the same link, there is a trilogarithmic expression, mentioned to have a "simple answer":
$$\frac 1{1^3}-\frac 1{3^3}+\frac 1{5^3}-\frac 1{7^3}+\dots
=\Im\operatorname{Li}_3(i)=\frac 1{32}\pi^3\ .$$

We start the computation, and "do something" first.
The substitution $t=\arctan(x/2)$ needs a smaller interval. So
we shift as a first step the integration from $[0,2\pi]$ to the symmetric
interval $[-\pi,\pi]$, breaking it into even and odd pieces, the odd part vanishes, the even part is twice the integral on $[0,\pi]$.

Let $J$ be the value of the integral to be computed. Then:
$$
\tag{9}
$$
$$
\begin{aligned}
J
&=
\int_0^{2\pi}x^2\;\cos x\; \operatorname{Li}_2(\cos x)\;dx
\\
&=
\int_{-\pi}^{\pi}(x+\pi)^2\;\cos(x+\pi)\; \operatorname{Li}_2(\cos (x+\pi))\;dx
\\
&=
-\int_{-\pi}^{\pi}(x^2+\underbrace{2\pi x}_{\text{odd}}+\pi^2)\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
\\
% &=
% -\int_{-\pi}^{\pi}x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
% -\pi^2\int_{-\pi}^{\pi}\cos x\; \operatorname{Li}_2(-\cos x)\;dx
% \\
&=
2
\underbrace{
\int_0^{\pi}-x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
}_{J_1}
+
2\pi^2
\underbrace{
\int_0^{\pi}-\cos x\; \operatorname{Li}_2(-\cos x)\;dx
}_{J_2}
\\
&=2J_1+2\pi^2 J_2\ .
\end{aligned}
$$
Here, after changing $x\to\pi-x$ we have
$$
\tag{10}
J_2
=
\int_0^{\pi}-\cos x\; \operatorname{Li}_2(-\cos x)\;dx
=
\int_0^{\pi}\cos x\; \operatorname{Li}_2(\cos x)\;dx
=\frac 12\pi^2-\pi\ .
$$
Thus $J_1$ gives the complexity.
For $J_2$, explicitly:
$$
\tag{11}
$$
$$
\begin{aligned}
J_2
&=
\int_0^{\pi/2}\cos x\; \operatorname{Li}_2(\cos x)\;dx
+
\int_0^{\pi/2}\cos (\pi-x)\; \operatorname{Li}_2(\cos(\pi-x))\;dx
\\
&=
\Big[\sin x \operatorname{Li}_2(\cos x)\Big]_0^{\pi/2}
-
\int_0^{\pi/2}\sin x\cdot\frac 1{\cos x}
\operatorname{Li}_1(\cos x)\cdot(-\sin x)\; dx
\\
&\qquad
-\Big[\sin x \operatorname{Li}_2(-\cos x)\Big]_0^{\pi/2}
+\int_0^{\pi/2}\sin x\cdot\frac 1{-\cos x}
\operatorname{Li}_1(-\cos x)\cdot(-\sin x)\; dx
\\
&=\int_0^{\pi/2}\frac {\sin^2 x}{\cos x}
\log\frac{1+\cos x}{1-\cos x}\; dx
\\
&\qquad\text{and with $t=\tan\frac x2$, $x=2\arctan t$, $dx=\frac2{1+t^2}\; dt$,
$\sin x=\frac {2t}{1+t^2}$, $\cos x=\frac{1-t^2}{1+t^2}$}
\\
&=
\int_0^1\frac{4t^2}{(1+t^2)^2}\cdot\frac{1+t^2}{1-t^2}
\cdot\log\left(\frac{(1+t^2)+(1-t^2)}{(1+t^2)-(1-t^2)}\right)
\cdot\frac 2{1+t^2}\; dt
\\
&=
-\int_0^1\frac{8t^2}{(1+t^2)^2(1-t^2)}\cdot\log t^2\; dt
\\
&=
2\int_0^1\left(\frac {2t}{1+t^2}+\log(1-t) - \log(1+t)\right)'
\log t\; dt
\\
&=
-2\int_0^1
\left(\frac {2t}{1+t^2}+\log(1-t) - \log(1+t)\right)\;\frac 1 t
\; dt
\\
&=-4\arctan\Big|_0^1 +2\Big[\operatorname{Li}_2(t) - \operatorname{Li}_2(-t)\Big]_0^1
\\
&=-\pi +\frac 12\pi^2\ .
\end{aligned}
$$
Here,
$\operatorname{Li}_2(1)=\zeta(2)=\frac 16\pi^2$.

And
$\operatorname{Li}_2(-1)=-\operatorname{Li}_2(1)+\frac 12\operatorname{Li}_2(1^2)=
-\frac 1{12}\pi^2$.

Computer check for the value of $J_2$. I will use pari/gp for this.
There are some issues near $0$ and $\pi$, so i will integrate numerically on some interval $[\epsilon, \pi-\epsilon]$.

? \p 50
   realprecision = 57 significant digits (50 digits displayed)
? eps = 0.000008;
? J2approx = intnum( x=eps, Pi-eps, cos(x)*dilog(cos(x)) )
%133 = 1.7931898077460863662640447913454517588781602204055
? Pi^2/2 - Pi
%134 = 1.7932095469548860709546021166585726834596803042453
? J2rewritten = intnum( x=0, Pi/2, sin(x)^2/cos(x) * log( (1+cos(x))/(1-cos(x)) ) )
%135 = 1.7932095469548860709546021166585726834596803042453
? J2rewritten2 = -intnum( t=0, 1, 16*t^2/(1+t^2)^2/(1-t^2) * log(t) )
%136 = 1.7932095469548860709546021166585726834596803042453

So the value $\frac 12\pi^2-\pi$ is numerically validated, it is the only way to check using pari/gp.

Using sage, we can "compute" / request an exact value:

sage: var('t');
sage: integral( -16*t^2 / (1+t^2)^2 / (1-t^2) * log(t), t, 0, 1 )
-pi + 1/2*pi^2
sage: integral( sin(x)^2/cos(x) * log( (1+cos(x))/(1-cos(x)) ), x, 0, pi/2 )
-pi + 1/2*pi^2

(Although for the initial form of the integral there are some maxima questions.)

So the integral $J_1$ is the issue.
I will use for the dilog term the identity
$
\operatorname{Li}_2(s)+
\operatorname{Li}_2(-s)=
\frac 12\operatorname{Li}_2(s^2)
$, thus obtaining in part a similar grouping of $\operatorname{Li}_2(\cos x)-\operatorname{Li}_2(-\cos x)$, which is favorable.
$$
\tag{12}
$$
$$
\begin{aligned}
J_1
&=
\int_0^{\pi}-x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
\\
&=
\frac 12
\int_0^{\pi}-x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
+
\frac 12
\int_0^{\pi}-x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
\\
% &=
% \frac 12
% \int_0^{\pi}x^2\;\cos x\; \operatorname{Li}_2(\cos x)\;dx
% +
% \frac 12
% \int_0^{\pi}-x^2\;\cos x\; \operatorname{Li}_2(-\cos x)\;dx
% \\
% &\qquad\qquad
% -\frac 14
% \int_0^{\pi}x^2\;\cos x\; \operatorname{Li}_2(\cos^2 x)\;dx
% \\
&=
\frac 12
\underbrace{
\int_0^{\pi}x^2\;\cos x\; \Big(
  \operatorname{Li}_2(\cos x)
- \operatorname{Li}_2(-\cos x)
\Big)
\;dx}_{J_{11}}
\\
&\qquad\qquad
-\frac 14
\underbrace{
\int_0^{\pi}x^2\;\cos x\; \operatorname{Li}_2(\cos^2 x)\;dx
}_{J_{12}}
\\
&=\frac 12 J_{11}-\frac 14 J_{12}\ .
\end{aligned}
$$
Here is a numerical check for the above equality.

eps = 0.000008;
J1  = intnum( x=eps, Pi-eps, -x^2 * cos(x) * dilog(-cos(x)) );
J11 = intnum( x=eps, Pi-eps,  x^2 * cos(x) * ( dilog(cos(x)) - dilog(-cos(x)) ) );
J12 = intnum( x=eps, Pi-eps, -x^2 * cos(x) * dilog( cos(x)^2 ) );

And with the above variables, the difference is in the range of the used precision...

? J1 - J11/2 - J12/4
%197 = 3.186183822264904554 E-58

Let us compute the "simpler" integral from above, $J_{12}$, first. We have:
$$
\tag{13}
$$
$$
\begin{aligned}
J_{12}
&=
\int_0^\pi x^2\;\cos x\; \operatorname{Li}_2(\cos^2 x)\;dx
\\
&=
\int_0^\pi (\ 2x\cos x + (x^2-2)\sin x\ )'\; \operatorname{Li}_2(\cos^2 x)\;dx
\\
&=2\pi\cos \pi\operatorname{Li}_2(1)
-
\int_0^\pi (\ 2x\cos x + (x^2-2)\sin x\ )\; \frac 1{\cos^2 x}\operatorname{Li}_1(\cos^2 x)\cdot (\cos^2 x)'\;dx
\\
&=-\frac 13\pi^3
-
2\int_0^\pi (\ 2x\cos x + (x^2-2)\sin x\ )\; \frac {\sin x}{\cos x}\log(\sin^2 x)\;dx
\\
&=
-\frac 13\pi^3
-
8\underbrace{\int_0^\pi x\sin x\log \sin x\;dx}_{\pi(\log 2-1)}
\\
&\qquad\qquad
-
4\int_0^\pi x^2\frac {\sin^2 x}{\cos x}\log \sin x\;dx
+
8\underbrace{
\int_0^\pi \frac {\sin^2 x}{\cos x}\log\sin x\;dx
}_{0\text{ via }x\to\pi-x}
\\
&=
-\frac 13\pi^3
-8\pi\log 2+8\pi
-2\int_0^\pi (x^2-(\pi-x)^2)\frac {\sin^2 x}{\cos x}\log \sin x\;dx
\\
&=
-\frac 13\pi^3
-8\pi\log 2+8\pi
-4\pi\underbrace{\int_0^\pi x\frac {\sin^2 x}{\cos x}\log \sin x\;dx}_{J_{121}}
\\
&=
-\frac 13\pi^3
-8\pi\log 2+8\pi
-
4\pi J_{121}\ ,\text{ where}
\\[2mm]
%
J_{121}
&:=\int_0^\pi x\;\frac {\sin^2 x}{\cos x}\;\log \sin x\;dx
\\
&=-\int_{-\pi/2}^{\pi/2} \left(x+\frac\pi 2\right)\;\frac {\cos^2 x}{\sin^2 x}\;\log \cos x\;\cdot\;\sin x\;dx
\\
&=-\int_{-\pi/2}^{\pi/2} x\;\frac {\cos^2 x}{\sin^2 x}\;\log \cos x\;\cdot\;\sin x\;dx
\\
&=2\int_0^{\pi/2} x\;\frac {\cos^2 x}{\sin^2 x}\;\log \cos x\;\cdot\;d(\cos x)
\\
&=
2\int_1^0 \arccos t\frac{t^2}{1-t^2}\log t\; dt
\\
&=
\int_0^1 2\arccos t\;\frac {(1-t^2)-1}{1-t^2}\;\log t\;dt
\\
&=
\underbrace{\int_0^1 2\arccos t\log t\;dt}_{2\log 2-4}
-
\int_0^1 \arccos t\left(\frac 1{1-t}+\frac 1{1+t}\right)\log t\;dt
\\
&= 2\log2-4
-
\int_0^1 \arccos t\;
(\operatorname{Li}_2(1-t))'\; dt
\\
&\qquad\qquad
+
\int_0^1 \arccos t\;
(\operatorname{Li}_2(1+t))'\; dt
-
\log(-1)
\int_0^1 \arccos t\cdot \frac 1{1+t}\; dt
\\
&=2\log2-4
-\arccos 0\cdot\operatorname{Li}_2(1)
\\
&\qquad\qquad
-
\int_0^1 \frac{\operatorname{Li}_2(1-t)}{\sqrt{1-t^2}}\; dt
+\arccos 0\cdot\operatorname{Li}_2(1)
+
\Re\int_0^1 \frac{\operatorname{Li}_2(1+t)}{\sqrt{1-t^2}}\; dt
\\
&=2\log2-4
-
\int_0^{\pi/2} \frac{\operatorname{Li}_2(1-\cos u)}{\sin u}\; \sin u\;du
+
\Re\int_0^{\pi/2} \frac{\operatorname{Li}_2(1+\cos u)}{\sin u}\; \sin u\; du
\\
&=
2\log2-4
-
\int_0^{\pi/2} \operatorname{Li}_2(1-\cos u)\; du
+
\Re\int_0^{\pi/2} \operatorname{Li}_2(1+\cos u)\; du
\\
&\qquad\text{ and with }
\operatorname{Li}_2(1-c) = -\operatorname{Li}_2(c) + \frac 16\pi^2 -\log(c)\log(1-c)\ ,\\
\\
&\qquad\text{ and with }
\operatorname{Li}_2(1+c) = -\operatorname{Li}_2(-c) + \frac 16\pi^2 -\log(-c)\log(1+c)\ ,\\
\\
&=
2\log2-4
+
\underbrace{
\int_0^{\pi/2} \operatorname{Li}_2(\cos u)\; du
-
\int_0^{\pi/2} \operatorname{Li}_2(-\cos u)\; du
}_{J_{1211}}
\\
&\qquad\qquad
+
\underbrace
{\int_0^{\pi/2} \log\cos u\cdot\log\frac {1-\cos u}{1+\cos u}\; du
}_{J_{1212}}
\ .
\end{aligned}
$$
Well, $J_{1212}$ can be computed "algorithmically", so we eliminate this from the task list first.
Recall, we have a formula to integrate expressions like $\frac 1{x-a}\log^2 x$. Using "polarization",
products $AB$ of different logarithms $A=\log(x-a)$ and $B=\log(x-b)$, can be reshaped to products of the "same" log, use
$AB=\frac 12(A^2+B^2-(A-B)^2)$. This gives:
$$
\begin{aligned}
J_{1212}
&=\int_0^{\pi/2} \log\cos u\cdot\log\frac {1-\cos u}{1+\cos u}\; du\\
&=\int_0^1 \log\frac{1-t^2}{1+t^2}\cdot\log\frac {(1+t^2)-(1-t^2)}{(1+t^2)+(1-t^2)}\; \frac 2{1+t^2}\; dt\\
&=
4\int_0^1 \frac{\log(1-t)\cdot\log t}{1+t^2}\; dt
+4\int_0^1 \frac{\log(1+t)\cdot\log t}{1+t^2}\; dt
-4\int_0^1 \frac{\log(1+t^2)\cdot\log t}{1+t^2}\; dt
\\
&=
4\left(
-\frac 1{128}\pi^3-\frac 1{32}\pi\log^2 2+\Im\operatorname{Li}_3\left(\frac {1+i}2\right)
\right)
+
4
\left(
+\frac {11}{128}\pi^3+\frac 3{32}\pi\log^2 2-2G\log 2-3\Im\operatorname{Li}_3\left(\frac {1+i}2\right)
\right)
\\
&\qquad\qquad
-
4\left(
-\frac {2}{128}\pi^3-\frac 2{32}\pi\log^2 2-G\log 2+2\Im\operatorname{Li}_3\left(\frac {1+i}2\right)
\right)
\\
&=
\frac 38\pi^3
+\frac 12\pi\log^2 2
-4G\log2
-16\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ .
\end{aligned}
$$
Numerical check:

i = I; pi = Pi; G = imag(dilog(i));
J1212 = intnum( u=0, pi/2, log(cos(u)) * log( (1-cos(u)) / (1+cos(u)) ) );
J1212_claimed = 3/8 * pi^3 + 1/2*pi*log(2)^2 - 4*G*log(2) - 16*imag(polylog(3, (1+i)/2 ));

? J1212
%187 = 0.72121319477695937923367893878228892950489772911404
? J1212_claimed
%188 = 0.72121319477695937923367893878228892950489772911404

To see that we have played a "purely linear game" with (5), here are some computational details.
We tacitly use $\frac 1{t^2+1}=\frac 1{2i}    \left(\frac1{t-i}-\frac 1{t+i}\right)$.
$$
\begin{aligned}
\int_0^1 \frac{\log^2 t}{1+t^2}\; dt
&=
\frac 1{2i}\left(
\int_0^1 \frac{\log^2 t}{t-i}\; dt
-
\int_0^1 \frac{\log^2 t}{t+i}\; dt
\right)
\\
&=\frac 1{2i}\Big[\ G_i(t)-G_{-i}(t)\ \Big]_0^1
\\
&=\frac 1{2i}\Big[\ G_i(1)-G_{-i}(1)\ \Big]
\\
&=\frac 1{2i}\left[\
-2\operatorname{Li}_3\left(\frac 1i\right)
+2\operatorname{Li}_3\left(\frac 1{-i}\right)
\ \right]
\\
&=2\Im  \operatorname{Li}_3(i)
\\
&=2\cdot \frac 1{32}\pi^3=\frac 1{16}\pi^3\ .
\end{aligned}
$$
Also:
$$
\begin{aligned}
\int_0^1 \frac{\log^2 (1-t)}{1+t^2}\; dt
&=
\frac 1{2i}\left(
\int_0^1 \frac{\log^2 t}{1-t-i}\; dt
-
\int_0^1 \frac{\log^2 t}{1-t+i}\; dt
\right)
\\
&=
\frac 1{2i}\left(
-
\int_0^1 \frac{\log^2 t}{t-(1-i)}\; dt
+
\int_0^1 \frac{\log^2 t}{t-(1+i)}\; dt
\right)
\\
&=\frac 1{2i}\Big[\ G_{1+i}(t)-G_{1-i}(t)\ \Big]_0^1
\\
&=\frac 1{2i}\Big[\ G_{1+i}(1)-G_{1-i}(1)\ \Big]\ ,
\\
&=\frac 1{2i}\left[\
-2\operatorname{Li}_3\left(\frac 1{1+i}\right)
+2\operatorname{Li}_3\left(\frac 1{1-i}\right)
\ \right]
\\
&=2\Im  \operatorname{Li}_3\left(\frac {1+i}2\right)
\ .
\end{aligned}
$$
And finally, with the substitution $u=t/(1-t)$:
$$
\begin{aligned}
&\!\!\!\int_0^1 \frac{\log^2 (t/(1-t))}{1+t^2}\; dt
\\
&=
\int_0^\infty \frac{\log^2 u}{1+\frac{u^2}{(1+u)^2}}\; \frac 1{(1+u)^2}\;du
\\
&=
\int_0^1 \frac{\log^2 u} {(1+u)^2+u^2}\;du
+
\int_1^\infty \frac{\log^2 u} {(1+u)^2+u^2}\;du
\\
&=
\int_0^1 \frac{\log^2 u} {(1+u)^2+u^2}\;du
+
\int_0^1 \frac{\log^2 u} {(u+1)^2+1^2}\;du
\\
&=
\int_0^1 \log^2 u\frac 1{2i}\left( \frac 1{u-\frac12(-1+i)} - \frac 1{u-\frac12(-1-i)} \right)\;du
\\
&\qquad\qquad
+
\int_0^1 \log^2 u\frac 1{2i}\left( \frac 1{u-(-1+i)} - \frac 1{u-(-1-i)} \right)\;du
\\
&=
\frac 1{2i}\Big[\ G_{(-1+i)/2}(t) -  G_{(-1-i)/2}(t)\ \Big]_0^1
+
\frac 1{2i}\Big[\ G_{-1+i}(t) -  G_{-1-i}(t)\ \Big]_0^1
\\
&=
\frac 1{2i}\left(
\
2\operatorname{Li}_3\left(\frac 2{-1-i}\right)
-
2\operatorname{Li}_3\left(\frac 2{-1+i}\right)
+
2\operatorname{Li}_3\left(\frac 1{-1-i}\right)
-
2\operatorname{Li}_3\left(\frac 1{-1+i}\right)
\ \right)
\\
&=
2\Im\operatorname{Li}_3\left(-1+i\right)
+
2\Im\operatorname{Li}_3\left(\frac {-1+i}2\right)
\qquad(z=1-i)
\\
&=
2\Im\Big(\
\operatorname{Li}_3(-z) -
\operatorname{Li}_3(-z^{-1})\ \Big)
=
2\Im\left(-\frac16\log^3 z-\frac 16\pi^2\log z\right)=\dots
\ .
\end{aligned}
$$
(So $\log 2$ and $\pi$ show up soon.)
Here is a quick numerical test for the above. (So that i can further type.)

? intnum( t=0, 1, log(t)^2 / (1+t^2) )
%231 = 1.9378922925187387609672696916938372001390805353678
? Pi^3/16
%232 = 1.9378922925187387609672696916938372001390805353678
? intnum( t=0, 1, log(1-t)^2 / (1+t^2) )
%233 = 1.1401548141775379563912195151801491021262916198375
? 2*imag( polylog(3, (1+i)/2) )
%234 = 1.1401548141775379563912195151801491021262916198375
? intnum( t=0, 1, log( t/(1-t) )^2 / (1+t^2) )
%235 = 2.5167020943309544685663530996649317514086075354493
? 2*imag( polylog(3, -1+i) + polylog(3, (-1+i)/2) )
%236 = 2.5167020943309544685663530996649317514086075354493
? z=1-I; 2*imag( -1/6*log(z)*(log(z)^2+pi^2) )
%237 = 2.5167020943309544685663530996649317514086075354493

In the following related post, pisco also computed these integrals using different methods.
Please compare to have an alternative view.

Computation of integrals, math stackexchange question 3854736

This was $J_{1212}$.
The remained integral  $J_{1211}$ is not so simple.
$$
\tag{14}
$$
$$
\begin{aligned}
J_{1211}
&=
\int_0^{\pi/2} u'\operatorname{Li}_2(\cos u)\; du
-
\int_0^{\pi/2} u'\operatorname{Li}_2(-\cos u)\; du
\\
&=
-
\int_0^{\pi/2} u\cdot
\frac{\sin u}{\cos u}\cdot\log\frac{1-\cos u}{1+\cos u}\; du
\\
&=
-\int_0^1 2\arctan t
\;\frac{2t}{1-t^2}\; \log t^2\;\frac 2{1+t^2}\; dt
\\
&=
-4
\int_0^1 \left(
\frac 1{1-t} - \frac 1{1+t} +\frac{2t}{1+t^2}
\right)\cdot
\arctan t\cdot
\log t\; dt
\\
&=-4(J_{1211a} - J_{1211b} + J_{1211c})\ .
\end{aligned}
$$
Here, $J_{1211a}$, $J_{1211b}$, $J_{1211c}$ are the correspondingly integrals obtained by dissolving the parentheses.

One can show using either $(8)$, or the linked related computations, the formulas for the integrals indexed $1211a$, $1211b$, $1211c$:
$$
\tag{15}
$$
$$
\begin{aligned}
J_{1211a} &= \frac 1{16}\left[\ -\pi^3-\pi\log^2 2+ 8G\log2 + 32\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ \right]\ ,\\
J_{1211b} &= \frac 1{64}\Big[\ -\pi^3 + 32G\log2\ \Big]\ ,\\
J_{1211c} &= \frac 1{16}\left[\ \pi^3+2\pi\log^2 2 -64\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ \right]\ ,
\\[3mm]
J_{1211} &= \frac 1{16}\left[\ -\pi^3-4\pi\log^2 2 +128\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ \right]\ ,
\\
J_{1212} &= \frac 1{16}\left[\ 6\pi^3+8\pi\log^2 2  -64G\log 2 - 256\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ \right]\ ,
\\
J_{121} &= 2\log 2-4 + J_{1211} +J_{1212}\\
&=
\frac 1{16}\left[\ 5\pi^3+4\pi\log^2 2  -64G\log 2 - 128\Im\operatorname{Li}_3\left(\frac {1+i}2\right)\ \right]
+2\log 2-4
\ .
\end{aligned}
$$
Numerical checks:

eps = 0.8e-5; pi = Pi; i = I;
G = imag( dilog(i) );
# J1211 = intnum( u=eps, pi/2, dilog(cos(u)) ) - intnum( u=eps, pi/2, dilog(-cos(u)) );
J1211  = intnum( t=0, 1, 4 * ( 1/(1-t) - 1/(1+t) +2*t/(1+t^2) ) * atan(t) * log(t) )
J1211a = intnum( t=0, 1, atan(t) * log(t) / (1-t) );
J1211b = intnum( t=0, 1, atan(t) * log(t) / (1+t) );
J1211c = intnum( t=0, 1, atan(t) * log(t) * 2*t / (1+t^2) );

J1211a - (-pi^3 -   pi*log(2)^2 +  8*G*log(2) + 32*imag(polylog(3, (1+i)/2))) / 16
J1211b - (-pi^3                 + 32*G*log(2)                               ) / 64
J1211c - (+pi^3 + 2*pi*log(2)^2               - 64*imag(polylog(3, (1+i)/2))) / 16

J1211
4*J1211a - 4*J1211b + 4*J1211c

Yes, the differences in the second block are covered by the precision used,
and we have a final answer for $J_{1211}$.

To have an example of calculation:
$$
\begin{aligned}
J_{1211b} &=
\frac 1{2i}
\int_0^1
\log t\cdot\log\frac {1+it}{1-it}\cdot\frac 1{t+1}\; dt\ ,
\\
\int_0^1
\frac {\log^2 t}{t+1}\; dt
&=
[\ G_{-1}(t)\ ]_0^1=-2\operatorname{Li}_3(-1)=\frac 32\zeta(3)
\ ,\text{ (but not needed)}
\\
\int_0^1
\frac {\log^2 (1+it)}{t+1}\; dt
&=
\int_1^{1+i}
\log^2 u\;\cdot\frac 1{(u-1)+i}\; du
\\
&=
[ \ G_{1-i}(t)\ ]_1^{1+i} =G_{1-i}(1+i)-G_{1-i}(1)
\\
&=
-\log(1+i)^2\cdot\operatorname{Li}_1(i)
+2\log(1+i)\cdot\operatorname{Li}_2(i)
\ ,
\\
\int_0^1
\frac {\log^2 (1-it)}{t+1}\; dt
&=\text{the complex conjugate of the above}\ ,
\\
\int_0^1
\frac {\log^2 \frac t{1+it}}{t+1}\; dt
&=
-
\int_0^{1/(1+i)}
\log^2 u\;\cdot\frac 1{\frac {iu}{u+i}+1}\; \frac 1{(u+i)^2}\; du
%
% u = t/(1+it), u + uit = t, t = u/(1-ui) = ui/(u+i)
\\
&=
\int_0^{1/(1+i)}
\log^2 u\;\cdot\left(\frac 1{u+\frac 12(1+i)} - \frac 1{u+i}\right)
\\
&=[\ G_{-(1+i)/2}(u)-G_{-i}(u)\ ]_0^{1/(1+i)} =
G_{-(1+i)/2}\left(\frac{1-i}2\right)-G_{-i}\left(\frac{1-i}2\right)
\\
&=
-\log^2\frac{1-i}2\cdot \operatorname{Li}_1(i)
+2\log\frac{1-i}2\cdot \operatorname{Li}_2(i)
-2\operatorname{Li}_3(i)
\\
&\qquad\qquad
-\log^3\frac{1-i}2
- 2\log\frac{1-i}2 \cdot\operatorname{Li}_2\left(\frac{1+i}2\right)
+ 2\operatorname{Li}_3\left(\frac{1+i}2\right)
\ .
\\
\int_0^1
\frac{\log^2 \frac t{1-it}}{t+1}\; dt
&=\text{the complex conjugate of the above value.}
\\
J_{1211b} &=
\frac 1{2i}
\int_0^1
\log t\;\log\frac {1+it}{1-it}\cdot\frac 1{t+1}\; dt
\\
&=
\frac 1{4i}
\int_0^1
\Bigg(\log^2(1+it)-\log^2(1-it)
\\
&\qquad\qquad\qquad\qquad
-\log^2\frac t{1+it} +\log^2\frac t{1-it}\Bigg)\cdot\frac 1{t+1}\; dt
\ ,
\end{aligned}
$$
and the computation leads to the claimed result.

to be continued...

(Please look around for the second part of the answer.)