# 推导1

$$
\begin{aligned}
L(a\_1, a\_2) = \sum\_{i=1}^N\sum\_{j=1}^Na\_ia\_jy\_iy\_jK(x\_i, x\_j) - \sum\_{i=1}^Na\_i && {1}
\end{aligned}
$$

为了简化公式，令：

$$
\begin{aligned}
f(i, j) = a\_ia\_jy\_iy\_jK(x\_i,x\_j)  && {2}
\end{aligned}
$$

公式（1）简化为：

$$
\begin{aligned}
L(a\_1, a\_2) = \sum\_{i=1}^N\sum\_{j=1}^Nf(i,j) - \sum\_{i=1}^Na\_i && {3}
\end{aligned}
$$

在公式（3）中，将$$a\_1$$、$$a\_2$$是变量，其它参数a是常量，把公式（3）分成包含变量的部分和常量部分：

$$
\begin{aligned}
L(a\_1, a\_2) = f(1,1)+f(1,2)+\sum\_{j=3}^Nf(1,j) \\
+f(2,1)+f(2,2)+\sum\_{j=3}^Nf(2,j) \\
+\sum\_{i=3}^Nf(i,1)+\sum\_{i=3}^Nf(i,2) + +\sum\_{i=3}^N\sum\_{j=3}^Nf(i,j) \\
-a\_1 - a\_2 - \sum\_{i=3}^Na\_i && {4}
\end{aligned}
$$

要L(a\_1, a\_2)对a\_1和a\_2求导，公式（4）中的常数部分对求导结果不影响，直接合并为一个不需要关心具体内容的常数项，得：

$$
\begin{aligned}
L(a\_1, a\_2) = f(1,1)+f(1,2)+\sum\_{j=3}^Nf(1,j) \\
+f(2,1)+f(2,2)+\sum\_{j=3}^Nf(2,j) \\
+\sum\_{i=3}^Nf(i,1)+\sum\_{i=3}^Nf(i,2)  \\
-a\_1 - a\_2 + \text{常数项}&& {5}
\end{aligned}
$$

根据f(i,j)的定义可知，f具有对称性，得：

$$
\begin{aligned}
L(a\_1, a\_2) = f(1,1)+2f(1,2)+f(2,2) \\
+2\sum\_{j=3}^Nf(1,j) +2\sum\_{j=3}^Nf(2,j) \\
-a\_1 - a\_2 + \text{常数项}&& {6}
\end{aligned}
$$


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://windmising.gitbook.io/lihang-tongjixuexifangfa/smo/17.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
