I would like to know how to correctly combine the sentence 1. with the sentence 2.
- People are interested in how these algorithms work.
- I am writing a book about algorithms... [here I need to recast the above sentence so it fits]
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.
You would normally use an adverbial clause:
You could also do it in various other ways, of course; the possibilities are endless. But why not make two separate sentences? There is no inherent benefit in a single sentence. In fact, some sentences can be overloaded with information, which makes it harder to see what the author meant.
If I absolutely had to combine these exact sentence with a relative construction, I could only do it like this:
I find this construction very cumbersome and I do not recommend it, but it might occur in sloppy speech. You just can't properly use the subject of an embedded sentence as a relative pronoun like this in English, which is what you'd have to do if you wanted to integrate these two sentences word by word. I'd rather recast it:
Here I have substituted workings. But it sounds awkward: you just wouldn't combine these two sentences with a relative pronoun in natural language; and workings has somewhat different connotations.
"I am writing a book about algorithms because people are interested in how algorithms work."